if has("multi_byte")
set encoding=unicode
let &termencoding = &encoding
" Set default encoding as UTF-8 with BOM
setglobal fileencoding=utf-8 bomb
" Auto detect the file encoding BOM unicode, utf-8, GBK, Big5, Latin1
set fileencodings=ucs-bom,utf-8,cp936,cp950,latin1
" Walkaround the encoding problem for fenc=utf-8 && enc=ucs-2
augroup i18n
autocmd!
autocmd BufReadPost * if &fileencoding == "utf-8" | let &encoding = &fileencoding | endif
augroup END
endif
" Enable the Chinese characters
"set guifont=Bitstream\ Vera\ Sans\ Mono:h10:cANSI,NSimSun:h11:cGB2312
set guifont=Consolas:h11:cANSI,NSimSun:h11:cGB2312
set guifontwide=NSimSun:h11:cGB2312
2009/08/13
VIM unicode
在 MS Windows 下面由于受 Byte Order Mark (BOM) 的控制, 需要对GVIM 做一些配置才能正常工作。 这包括 tenc, enc, fencs, guifont, guifontwide。 这样一来,vim就可以自动 根据BOM做出正确的显示了,同时也可以自动识别GBK和BIG5。
订阅:
博文评论 (Atom)
BlockChain 相关电子书
@copyright of Sam Chadwick - https://thehub.thomsonreuters.com/groups/bitcoin/blog/2017/09/10/blockchain-paper Blockchain Papers A c...
-
如何在 OpenWRT 下产生随机数: MY_RANDOM=$(head /dev/urandom | tr -dc "0123456789" | head -c4) 如果是的Bash, Zsh, 或者BusyBox启用了RANDOM, 是可以直接使用内置...
-
Finally the my Ubuntu linux is authenticated with the Windows IAS 802.1x RADIUS server. Thanks Xsupplicant, thanks Open1x project to provid...
-
@copyright of Sam Chadwick - https://thehub.thomsonreuters.com/groups/bitcoin/blog/2017/09/10/blockchain-paper Blockchain Papers A c...
1 条评论:
注意: `set encoding'的部分需要放在VIMRC最开始的位置,否则termencoding的调整可能会引起vim菜单在中文Windows (locale)下字体显示不正常。
发表评论