To run Neovim on Windows, you can either use the terminal neovim or use a GUI for Neovim. If you use terminal Nvim, you may encounter various annoying issues. Based on my experience of using Neovim on Windows, it is highly recommended to use GUI Nvim instead of terminal Nvim. Nvim-qt is one of the many GUI front end for Neovim and it is packaged with Neovim by default on Windows platform.

In this post, I will give a summary on how to solve a few issues with Nvim-qt.

General settings

Where should I put ginit.vim?

Nvim-qt will use your Nvim configurations as well as a configuration file specifically for GUIs. The config file is called ginit.vim and you should put it under the same directory where nvim configuration file is. The directory is something like C:\Users\Administrator\AppData\Local\nvim.

How do I pass options to neovim

Since nvim-qt has its own options, it will get confused if you simply provide it with nvim options. You need to specify nvim options after --. For example, to open a file using specific configuration file, use the following command:

nvim-qt some_file.txt -- -u init.vim

Shift+Insert does not work in nvim-qt

In Nvim-qt, when we press Shift+insert in insert mode, it will add <S-Insert> instead of the text on system clipboard. To fix this problem, we can use the following mapping:

inoremap <silent>  <S-Insert>  <C-R>+

GUI settings

Nvim-qt has also provided a list of its own command to configure its behavior. I list some of the settings in the following sections.

How to turn off the GUI tabline?

The GUI tabline of nvim-qt is ugly. We can use GuiTabline 0 inside ginit.vim to disable GUI tabline and use the terminal nvim tabline.

How to turn off GUI completion menu

The GUI completion menu is also ugly and too long, since it shows the detailed docstrings of object methods.

You can disable it by adding the following setting in ginit.vim:

GuiPopupmenu 0

How to reduce line space?

You can use GuiLinespace to control the line space in nvim-qt, for example, GuiLinespace 1.

How to change the font used?

You can change the font Nvim-qt use by default. To check the default font used, use GuiFont command inside nvim-qt without argument. On my system, the output is Consolas:h11.

According to nvim-qt documentation, the following attributes for font are available:

hXX - height is XX in points
b   - bold weight
l   - light weight
i   - italic

You can chain different attribute with : character. For example, to use Hack in 10 point and light weight, use the following command:

:GuiFont Hack:h10:l

After issuing the above command, you may see the following warning message:

Warning: Font “Hack” reports bad fixed pitch metrics.

To suppress this message, use the bang version of GuiFont command instead:

:GuiFont! Hack:h10:l

How to open nvim-qt with maximized window?

Add the following settings to your ginit.vim file:

call GuiWindowMaximized(1)

My complete configurations for Neovim can found in my GitHub repo. For How to configure Neovim for Python development, see this post.

References