VIM不能正常的显示中文,请各位帮忙!谢谢

OOo,TeX,KO,ABI,GIMP,Picasa,ProE,QCAD,Inkscape,Kicad,Eagle
回复
luan_sheng
帖子: 21
注册时间: 2006-03-20 7:54
送出感谢: 0
接收感谢: 0

VIM不能正常的显示中文,请各位帮忙!谢谢

#1

帖子 luan_sheng » 2006-03-24 21:08

当前用户目录下建立文件.vimrc,设置如下:
fileencodings=ucs-bom,utf-8,cp936,big5,euc-jp,euc-kr,latin1,gb2312
如果这样,能够正常的显示GBK编码的中文
,但是如果按照一个网上流行的版本,
不知道为什么在我这里不行
" multi-encoding setting
if has("multi_byte")
"set bomb
set fileencodings=ucs-bom,utf-8,cp936,big5,euc-jp,euc-kr,latin1
" CJK environment detection and corresponding setting
if v:lang =~ "^zh_CN"
" Use cp936 to support GBK, euc-cn == gb2312
set encoding=cp936
set termencoding=cp936
set fileencoding=cp936
elseif v:lang =~ "^zh_TW"
" cp950, big5 or euc-tw
" Are they equal to each other?
set encoding=big5
set termencoding=big5
set fileencoding=big5
elseif v:lang =~ "^ko"
" Copied from someone's dotfile, untested
set encoding=euc-kr
set termencoding=euc-kr
set fileencoding=euc-kr
elseif v:lang =~ "^ja_JP"
" Copied from someone's dotfile, untested
set encoding=euc-jp
set termencoding=euc-jp
set fileencoding=euc-jp
endif
" Detect UTF-8 locale, and replace CJK setting if needed
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
endif
else
echoerr "Sorry, this version of (g)vim was not compiled with multi_byte"
endif
这是我的我的本地local信息如下:
LC_CTYPE=zh_CN.utf8
LC_NUMERIC="zh_CN.GBK"
LC_TIME="zh_CN.GBK"
LC_COLLATE="zh_CN.GBK"
LC_MONETARY="zh_CN.GBK"
LC_MESSAGES="zh_CN.GBK"
LC_PAPER="zh_CN.GBK"
LC_NAME="zh_CN.GBK"
LC_ADDRESS="zh_CN.GBK"
LC_TELEPHONE="zh_CN.GBK"
LC_MEASUREMENT="zh_CN.GBK"
LC_IDENTIFICATION="zh_CN.GBK"
LC_ALL=
个人怀疑是不是与LC_CTYPE有关系,不知道LC_CTYPE是什么意思?
头像
karron
帖子: 6226
注册时间: 2005-06-11 14:03
来自: 不明真相的群众
送出感谢: 0
接收感谢: 0
联系:

#2

帖子 karron » 2006-03-25 9:43

简单的可以为什么要搞复杂的呢?
我的blog,关于技术,软件,linux,vim <---- 所有博客均被河蟹.
回复

回到 “办公、图像、机械电子设计等”