$ show equalsraf/neovim-qt
neovim-qt is a Qt-based graphical user interface for the Neovim text editor. It provides a full-featured GUI frontend that communicates with Neovim via the msgpack-RPC protocol, supporting all standard editing operations, multiple windows, tabs, popup menus, scrollbars, and a file tree view. The application is cross-platform (Windows, macOS, Linux) and integrates deeply with Neovim's extended UI features, including external popup menus, tablines, and grid-based rendering. The architecture is modular: the core library (neovim-qt) handles RPC communication via MsgpackIODevice and NeovimConnector, while the GUI layer (neovim-qt-gui) provides the main window, shell widget, input handling, and UI extensions. The ShellWidget is a standalone, reusable Qt widget that renders a terminal-like grid of cells with full color, font attributes, cursor blinking, and ligature support. Input events are converted to Neovim's key notation through platform-specific modules. The application also includes a VimL plugin (nvim_gui_shim.vim) that exposes GUI commands like GuiFont, GuiTabline, and GuiScrollBar. Key entry points include main.cpp (application startup), App class (command-line parsing and window management), MainWindow (orchestrates shell, tabline, scrollbar, treeview), and Shell (manages Neovim attachment and redraw notifications). External dependencies are Qt6, msgpack-c, and Neovim itself. The build system uses CMake with support for various package managers and CI pipelines (GitHub Actions, CircleCI, Azure Pipelines).
The LLM identified 3 files worth highlighting for reuse:
A self-contained Qt widget that renders a terminal-like grid of cells with full color support, font attributes (bold, italic, underline, undercurl, strikethrough), cursor blinking, and ligature handling. It can be instantiated independently (e.g., fromFile()) and provides configurable fonts, line spacing, and cursor styles. The widget handles scroll, clear, and resize operations efficiently, making it reusable for any project needing a terminal emulation widget.
A generic msgpack-RPC layer over QIODevice that handles packing/unpacking of messages, request/response dispatch, and notification handling. It supports EXT type registration for custom types (e.g., Neovim's Buffer, Window, Tabpage) and provides a clean signal/slot interface for asynchronous communication. This component can be extracted and reused in any Qt project that needs msgpack-based RPC over any QIODevice (stdin/stdout, sockets, etc.).
A factory and manager for Neovim connections, supporting spawning a new Neovim process, connecting via TCP socket, Unix socket, or stdin/stdout. It handles API version negotiation, error reporting, and reconnection logic. The class encapsulates the lifecycle of a Neovim instance and provides a consistent interface for different transport methods. While somewhat coupled to Neovim's protocol, the pattern of a connection factory with multiple transport backends is reusable for other RPC-based tools.