Skip to content
Jean Guyomarc'h edited this page Jun 19, 2020 · 4 revisions

Neovim provides the guifont option. The following syntax is understood by Eovim:

set guifont=FontName-FontSize[:ExtraOptions]

What's all this?

  • FontName seems pretty straightforward, that's just the name of the font, without extraneous styles;
  • FontSize is the size (in pt) of the font
  • If you have extraneous parameters, as listed in the fontconfig format, you can just provide them to eovim.

If you have whitespaces, you can prefix them with a backslash. That's a vim's constraint, see the doc for details.

To make things a little more understandable let's take some examples with Fira Code. If you search in the font installed in your system, you may have something as follows.

In the image above, there are five variants of Fira Code. For all of them, the font name is the same: Fira Code. Assuming you want to use a font size of 14pt, the following listing shows, line by line, how to select which font variant (from left to right):

set guifont=Fira\ Code-14
set guifont=Fira\ Code-14:style=Bold
set guifont=Fira\ Code-14:style=Light
set guifont=Fira\ Code-14:style=Medium
set guifont=Fira\ Code-14:style=Retina

If you really want to understand how the parameters after the column : are parsed, you can take a look at what the EFL do.

Clone this wiki locally