neovim-qt: Problem with GuiFont and NerdFonts and Powerline

OS: ArchLinux Version: git master Fonts: https://github.com/ryanoasis/nerd-fonts and PowerlineFonts ginit.vim: Guifont MesloLGLDZ NF RegularForPowerline:h13 Error: Unknown font: MesloLGLDZ NF RegularForPowerline

How to set Powerline fonts or NerdFonts? On Gnome-Terminal fonts works.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 45 (18 by maintainers)

Most upvoted comments

Now, those fonts do have mono in their names, so I’d assume they would be fixed pitch.

If its throwing that error it is because the font metrics don’t seem to be monospace. Sometimes this happens because the fonts are buggy, but there are other valid reasons for this depending on your system.

I can tell neovim-qt to use not-fixed-pitched fonts?

Add a bang, use GuiFont! ...

@kierun try fc-list | grep Inconsolata and get the font name, example: /home/***/.fonts/Fura Mono Medium for Powerline Nerd Font Complete.otf: FuraMonoForPowerline Nerd Font:style=Medium

Guifont FuraMonoForPowerline Nerd Font:h9

but how to set the font? i typed

:set guifont

and get

E519: Option not supported: guifont

Lots of fonts, not entirely sure what is the right variation you wanted. I used this one

./unpatched-sample-fonts/Meslo/L-DZ/Meslo LG L DZ Regular for Powerline.otf

The name for this one is Meslo LG L DZ for Powerline. The Regular in the name is just the font style but it is usually not part of the font name. A good way to find this in linux systems to call fc-list it should show all the font files in your system, followed by their name and some more attributes.

Another problem… I am getting a lot of Font X is not a fixed pitched font error when setting some fonts. Now, those fonts do have mono in their names, so I’d assume they would be fixed pitch. Any idea how to find which fonts are fixed pitched or whether I can tell neovim-qt to use not-fixed-pitched fonts?

@jdhao neovim currently does not support this, but the option would be guioptions (which already existed in vim). This has been discussed a couple of times but I dont think there is an open issue for it.

Going back to the original issue. nvim-qt should show a message for errors in ginit.vim, for example like the following invalid command. If that is not the case we can open a new issue for this.

vim

Do you have true color enabled in both nvim-qt and gvim? I am using lightline (not powerline | airline).

I just tried that font and it renders correctly for me. Besides it is beautiful 😄

screen shot 2016-08-18 at 1 37 38 pm

@joe23rep It should be in ginit.vim, something like:

function! IsOnSomeParticularMachine(hostname)
    return match(system("echo -n $HOST"), a:hostname) >= 0
endfunction

if IsOnSomeParticularMachine('jagupard')
    GuiFont! PragmataPro Nerd Font Mono:h10
else
    GuiFont! PragmataPro Nerd Font Mono:h9
endif