惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
H
Help Net Security
腾讯CDC
宝玉的分享
宝玉的分享
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
爱范儿
爱范儿
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MyScale Blog
MyScale Blog
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
D
Docker
V
V2EX
Last Week in AI
Last Week in AI
G
Google Developers Blog
IT之家
IT之家
C
Check Point Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 聂微东

jdhao's digital space

Conversion between base64 and OpenCV or PIL Image 腾讯云对象存储博客图床开启 CDN 加速(不需要购买额外域名) Search and Replace in Multiple Files in Vim/Neovim Change Table Column Width in LaTeX Image or Table Side by Side in LaTeX LaTeX 并排显示图像或表格 Firenvim: Neovim inside Your Browser Content inside HTML tags missing in Latest Hugo? Creating Markdown Front Matter with Ultisnips Labelme JSON 标注格式转 voc XML 格式 Nifty Nvim Techniques That Make My Life Easier -- Series 6 macOS 下如何为视频制作字幕 Running Command Asynchronously inside Neovim Resolving Merge Conflict after Git Stash Pop Pylint: command not found? A Hands-on Experience with Neovim's Built-in LSP Support How to Convert PDF to Images with Imagemagick 互联网上常用缩略语集锦 File Backup in Neovim Converting PDF Pages to Images with Poppler Nifty Nvim Techniques That Make My Life Easier -- Series 5 Neovim Configuration for System-wide Use How to sort a list of tuple or list in Python -- lambda or itemgetter? Building A Vim Statusline from Scratch 人类第一颗原子弹爆炸始末 Distributed Training in PyTorch with Horovod Learning Expect Programming Essential Knowledge about SSH Nifty LaTeX Techniques -- Series 1 更改 Adsense 邮寄地址,重新寄送 PIN
Nvim-qt Settings on Windows 10
2019-01-17 · via jdhao's digital space

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, I recommend you using a GUI client for Nvim instead of the terminal one.

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 configurations related to nvim-qt?#

Nvim-qt will use your Nvim configurations as well as a GUI configuration file1. The GUI config file is named ginit.vim, and you should put it under the same directory as init.vim. The directory is something like C:\Users\Administrator\AppData\Local\nvim on Windows. If you are inside Neovim, you can also use the command :echo stdpath('config') to show the exact directory.

How do I pass options to neovim when starting nvim-qt on the command line?#

Since nvim-qt has its own options, it will get confused if you simply provide it with nvim startup options. You need to specify nvim options after --. For example, to open a file using specific configuration, 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 a literal <S-Insert>, instead of placing the text on the system clipboard to the cursor position. To fix this issue, 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 behaviors. I list some of the settings in the following sections.

How to change the font used?#

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

According to nvim-qt documentation, the following attributes for fonts 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 font Hack in 10 point and light weight, use the following command:

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:

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 TUI tabline.

Although we have set GuiTabline 0 in ginit.vim, but it seems that it is still not disabled completely. If you open up a file with nvim-qt, the GUI tabline appears and then disappears quickly.

To disable it completely, i.e., not showing at all, there are two ways currently. One way is to use the --no-ext-tabline option when invoking nvim-qt:

The second way is to edit the Windows registry for nvim-qt. Go to Computer\HKEY_CURRENT_USER\Software\nvim-qt\nvim-qt and add a new String Value. The Name field should be ext_tabline and the Data field should be false. Then the GUI tabline should disappear completely.

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 (see image below).

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

How to reduce line space?#

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

How to open nvim-qt with maximized window?#

Add the following settings to your ginit.vim file:

call GuiWindowMaximized(1)

How to change cursor color in nvim-qt?#

According to this issue, currently, it is not possible to change the cursor position color in nvim-qt. Nvim-qt just sets the cursor to the reverse of background color.

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

References#