Skip to content

Configuration

daa84 edited this page Jan 4, 2021 · 32 revisions

Configuration

GUI specific configuration can be placed at ginit.vim file. Usually at ~/.config/nvim/ginit.vim path. In this file it is possible to set nvim-gtk specific settings by check g:GtkGuiLoaded variable.

if exists('g:GtkGuiLoaded')
  " some code here
endif

Font settings

By default gnome settings are used:

gsettings get org.gnome.desktop.interface monospace-font-name

Also it is possible to set font use next command:

call rpcnotify(1, 'Gui', 'Font', 'DejaVu Sans Mono 12')

Or just use neovim-qt config commands:

GuiFont Font Name:h14

neovim-qt api support limited to only font settings.

Ligatures

No addition configuration needed, just use special font (e.g. Fira Code)

OpenType features

You can enable opentype features (e.g. for Iosevka font) with command GuiFontFeatures

GuiFontFeatures PURS, cv17

or rpc call

call rpcnotify(1, 'Gui', 'FontFeatures', 'PURS, cv17')

Options

To disable external autocompletion popup menu (enabled by default)

call rpcnotify(1, 'Gui', 'Option', 'Popupmenu', 0)

To disable external tabline (enabled by default)

call rpcnotify(1, 'Gui', 'Option', 'Tabline', 0)

To enable cmdline popup (disabled by default). This function currently have some limitations.

call rpcnotify(1, 'Gui', 'Option', 'Cmdline', 1)

To change cursor blinking (default: will continue to blink continuously). '0' will set the cursor to never blink, a positive number will set it to stop blinking after that number of blinks, and a negative value will make it never stop blinking.

call rpcnotify(1, 'Gui', 'Command', 'SetCursorBlink', '10')

Environment variables

NVIM_GTK_NO_HEADERBAR=1 hides 'headerbar' bar.

NVIM_GTK_PREFER_DARK_THEME=1 allow users to use the dark theme variant.

NVIM_GTK_NO_WINDOW_DECORATION=1 disable window decorations.

Command line

nvim-gtk -h

Clipboard

To enable native gtk clipboard support let g:GuiInternalClipboard = 1

Commands

NGToggleSidebar - toggle sidebar

NGTransparency - enable transparency. Command take one or two arguments. First one is background alpha. This value does not change alpha of areas filled with non background color. Second argument is filled alpha. Example: :NGTransparency .5 .5 :NGTransparency .8

NGPreferDarkTheme - enable/disable dark theme Example :NGPreferDarkTheme on :NGPreferDarkTheme off

NGShowProjectView - show project view

NGSetCursorBlink - set cursor blink, see the description in options. Example: :NGSetCursorBlink 10

Runtime

There is NeoVIM plugin to support neovim-gtk commands. This plugin by default installed at $(PREFIX)/share/nvim-gtk/runtime and automatically loaded at startup. But this path can be overwritten by setting environment variable NVIM_GTK_RUNTIME_PATH.

Plugin Manager

Plugin Manager GUI can be found at application menu. Currently plugin manager is limited to plug-vim settings generation. It stores plug-vim settings at ~/.config/nvim-gtk/settings.vim file. This file later sourced with source file_path command before init.vim or ginit.vim is loaded. So to make this manager work it is need to:

  • install vim-plug
  • disable vim-plug configuration in init.vim (before disabling vim-plug configuration it is better to open plugin manager gui and press 'Ok' - this way current vim-plug configuration will be copied)

Note that not all vim-plug options are supported.