vim正确显示各种中文的基本设置
发表于 : 2007-06-05 22:31
if has("gui_win32") " NT Windows
set encoding=ucs-2le
set termencoding=ucs-2le
set fileencodings=ucs-bom,utf-8,ucs-2le,euc-cn,cp936
elseif has("x11") " X Window
set encoding=utf-8
set termencoding=utf-8
set fileencodings=ucs-bom,utf-8,ucs-2le,euc-cn,cp936
endif
以上设置基本可以保证在windows下gvim和linux下gvim,vim都能够正确显示各种编码集的中文。
set encoding=ucs-2le
set termencoding=ucs-2le
set fileencodings=ucs-bom,utf-8,ucs-2le,euc-cn,cp936
elseif has("x11") " X Window
set encoding=utf-8
set termencoding=utf-8
set fileencodings=ucs-bom,utf-8,ucs-2le,euc-cn,cp936
endif
以上设置基本可以保证在windows下gvim和linux下gvim,vim都能够正确显示各种编码集的中文。