2008/09/26

VIM Tips

I am running in a English version Windows XP in office. The default encoding of the OS is english! While I still want to be able to work with some Chinese document in VIM, how can I make it happen?
That's simple, put this line into your vimrc file
set guifont=Bitstream\ Vera\ Sans\ Mono:h10:cANSI
set guifontwide=NSimSun:h11:cGB2312

VIM will be using NSimSun to display the Chinese characters. :)
And "Bitstream Vera Sans Mono" to be used for ANSI characters.

Indeed this option can be set locally for each individual files by using the VIM modeline
vim:ts=4:sw=4:expandtab:enc=utf8
All the VIM option can be changed locally. Don't forget to put this modeline into the comments :D

VIM is fantastic cool~~~
发表评论