GVim: find out if guifont is available

I share my vim settings on several different machines that do not necessarily have exactly the same configuration.

Now, if my favorite font is only available on one system, but not on another, this leads to the problem that gvim is using a backup, which might not be the best choice.

So: Is there a way to make several attempts set guifont=...and somehow check if it was successful? Or is there a way to provide a list of fonts to try?

+5
source share
2 answers

You can tell Vim a list of fonts:

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

Vim will try the first, then the second ...

:h guifont does not indicate whether there is a limit on the number of options.

+13
source

/ , , (- ), , ..

, $HOSTNAME , "" .[g]vimrc , :

" Put this in ~/.gvimrc:
" Source system-specific .gvimrc first.
if filereadable(expand('~/local/.gvimrc'))
    source ~/local/.gvimrc
endif

, .

+1

All Articles