Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GVim: find out if guifont is available

Tags:

vim

fonts

I'm sharing my vim settings across a number of different machines, which don't neccessarily have exactly the same configuration.

Now if my favourite font is only available on one system but not another, this leads to the problem that gvim uses a fallback which may not be the best choice.

So: Is there a way to do multiple tries of set guifont=... and somehow check whether it was successful? Or is there a way to provide a list of fonts to try?

like image 881
Dave Vogt Avatar asked Sep 06 '12 08:09

Dave Vogt


1 Answers

You can give Vim a list of fonts:

set guifont=Monaco:h24,Inconsolata-gz:10

Vim will try the first then the second…

:h guifont doesn't tell if there's a limit to the number of choices.

like image 51
romainl Avatar answered Oct 13 '22 19:10

romainl