I develop on Linux at home and on Windows at work. I'd like to use the same vimrc file in both environments. The problem I have with this is that on Windows, I want to have the editor use the Consolas font, and on linux, a different font. How can I check the environment so I can conditionally set the editor font? (I am familiar with the actual command to change font; it's the conditional I don开发者_开发百科't get)
Exception from my .vimrc
" adjust configuration for such hostile environment as Windows {{{
if has("win32") || has("win16")
lang C
set viminfo='20,\"512,nc:/tmp/_viminfo
set iskeyword=48-57,65-90,97-122,_,161,163,166,172,177,179,182,188,191,198,202,209,211,230,234,241,243,143,156,159,165,175,185
else
set shell=/bin/sh
endif
" }}}
Have a look here:
http://objectmix.com/editors/149466-operating-system-checking-vimrc-files.html
(and I quote):
let os = substitute(system('uname'), "\n", "", "") if os == "SunOS" " Do Sun-specific stuff. ... elseif os == "Linux" " Do Linux-specific stuff. ... endif
精彩评论