vim 手册指出:
On systems where 'guifontset' is supported (X11) and 'guifontset' is
not empty, then 'guifont' is not used.
Spaces after a comma are ignored. To include a comma in a font name
precede it with a backslash. Setting an option requires an extra
backslash before a space and a backslash. See also
|option-backslash|. For example: >
:set guifont=Screen15,\ 7x13,font\\,with\\,commas
will make Vim try to use the font "Screen15" first, and if it fails it
will try to use "7x13" and then "font,with,commas" instead.
所以,我想做以下事情:
if has("gui_running")
if has("gui_gtk2")
set guifont=Droid\ Sans\ Mono,Inconsolata,Monospace
elseif has("gui_win32")
set guifont=Droid\ Sans\ Mono:h10,Consolas:h11:cANSI
endif
endif
麻烦的是它对我不起作用...我已经在 CentOS6.3 和 Debian Wheey 上尝试了几个小时,但是当我像这样编写这个命令时,VIM 只会以 Sans 字体开始。难道我做错了什么?您如何巧妙地检测系统上有哪些字体?