NewsCrawler.org

ng: a simple Go-based GUI for Neovim on Linux

ng: Neovim のためのシンプルな GUI
Image: zenn.dev

ng is a minimal GUI client for Neovim on Linux (X11 and Wayland), written in Go by Shougo and released under the MIT license. It does not build a new editor on top of Neovim, and it has no tabs, popups or animations of its own. Settings come from Neovim options such as guifont, g:ng_* variables and command-line arguments, not from a separate configuration file.

ng uses only the ext_linegrid[1] part of the Neovim UI protocol, so it shows the same screen as terminal Neovim. Its screen output can be checked automatically by comparing it with Neovim's screenstring() results. In 176 key presses measured on Manjaro Linux with Neovim 0.13 nightly, the median time from key press to display was 7.95 ms. To avoid flicker, ng waits until Neovim has been quiet for 4 ms, but no longer than 16 ms, because Neovim sometimes sends one change in several flush[3] batches.

Japanese input works through the system IME[2], such as fcitx5 or IBus, via SDL. On X11, text being converted appears in the IME's own window, while on Wayland it is drawn at the cursor. ng uses SDL3, FreeType and fontconfig and calls their C APIs directly through cgo[4], not through Go bindings.

Read the original zenn.dev

Sources

  • Zenn JA

    ng: Neovim のためのシンプルな GUI

    69 likes15 bookmarks0 comments

Published: First seen: Читать по-русски

Open as a page