*gui.txt* Nvim
VIM REFERENCE MANUAL by Bram Moolenaar
Nvim Graphical User Interface *gui* *GUI*
Any client that supports the Nvim |ui-protocol| can be used as a UI for Nvim.
And multiple UIs can connect to the same Nvim instance! The terms "UI" and
"GUI" are often used interchangeably because all Nvim UI clients have the same
potential capabilities; the "TUI" refers to a UI client that outputs to your
terminal, whereas a "GUI" outputs directly to the OS graphics system.
Except where noted, this document describes UI capabilities available to both
TUI and GUI (assuming the UI supports the given feature). See |TUI| for notes
specific to the terminal UI. Help tags with the "gui-" prefix refer to UI
features, whereas help tags with the "ui-" prefix refer to the |ui-protocol|.
==============================================================================
Third-party GUIs *third-party-guis* *vscode*
Nvim provides a builtin "terminal UI" (|TUI|), but also works with many
(third-party) GUIs which may provide a fresh look or extra features on top of
Nvim. For example, "vscode-neovim" essentially allows you to use VSCode as
a Nvim GUI.
- vscode-neovim (Nvim in VSCode!) https://github.com/vscode-neovim/vscode-neovim
- Firenvim (Nvim in your web browser!) https://github.com/glacambre/firenvim
- Neovide https://neovide.dev/
- Goneovim https://github.com/akiyosi/goneovim
- Nvy https://github.com/RMichelsen/Nvy
- Neovim-Qt (Qt5) https://github.com/equalsraf/neovim-qt
- VimR (macOS) https://github.com/qvacua/vimr
- Others https://github.com/neovim/neovim/wiki/Related-projects#gui
Type |gO| to see the table of contents.
==============================================================================
Starting the GUI *gui-config* *gui-start*
*ginit.vim* *gui-init* *gvimrc* *$MYGVIMRC*
For GUI-specific configuration Nvim provides the |UIEnter| event. This
happens after other |initialization|s, or whenever a UI attaches (multiple UIs
can connect to any Nvim instance).
Example: this sets "g:gui" to the value of the UI's "rgb" field: >
:autocmd UIEnter * let g:gui = filter(nvim_list_uis(),{k,v-> v.chan==v:event.chan})[0].rgb
<
------------------------------------------------------------------------------
Stop or detach the current UI
*:detach*
:detach
Detaches the current UI. Other UIs (if any) remain attached.
The server (typically `nvim --embed`) continues running as
a background process, and you can reattach to it later.
Before detaching, you may want to note the server address:
>vim
:echo v:servername
<
Note: The server closes the UI RPC channel, so :detach
inherently "works" for all UIs. But if a UI isn't expecting
the channel to be closed, it may be (incorrectly) reported as
an error.
Note: Not supported on Windows yet.
------------------------------------------------------------------------------
Restart Nvim
*:restart*
:restart
Restarts the Nvim server with the same startup arguments
|v:argv| and reattaches the current UI to the new server.
All other UIs will detach.
This fails when changes have been made and Vim refuses to
|abandon| the current buffer.
Note: If the current UI hasn't implemented the "restart" UI
event, this command is equivalent to `:qall`.
Note: Only works if the UI and server are on the same system.
Note: Not supported on Windows yet.
:restart!
Force restarts the Nvim server, abandoning