让vim支持中文显示

vim中文问题真是很烦人,google了一圈都没有真正能解决的办法,后来一次无意间在一篇博客中看到这种方法,确实很奏效

 

查看configure --help:
...
--enable-workshop       Include Sun Visual Workshop support.
--disable-netbeans      Disable NetBeans integration support.
--enable-sniff          Include Sniff interface.
--enable-multibyte      Include multibyte editing support.
--enable-hangulinput    Include Hangul input support.
--enable-xim            Include XIM input support.
--enable-fontset        Include X fontset output support.
...

选项有很多,但中间加黑的那一项,就是它了!多字节编辑支持,重新编译一次
$./configure --enable-multibyte
$ make && sudo make install

查看安装后的版本信息

[root@localhost vim73]# vim --version

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jan 11 2011 16:17:51)

编译者 root@localhost.localdomain

正常版本 无图形界面。  可使用(+)与不可使用(-)的功能:

-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent 

-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 

-conceal +cryptv -cscope +cursorbind +cursorshape +dialog_con +diff +digraphs 

-dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path 

+find_in_path +float +folding -footer +fork() +gettext -hangul_input +iconv 

+insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent 

+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape 

-mouse_dec +mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse 

+mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype 

+path_extra -perl +persistent_undo +postscript +printer -profile -python 

-python3 +quickfix +reltime -rightleft -ruby +scrollbind +signs +smartindent 

-sniff +startuptime +statusline -sun_workshop +syntax +tag_binary 

+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title

 -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo 

+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp

 -xterm_clipboard -xterm_save 

     系统 vimrc 文件: "$VIM/vimrc"

     用户 vimrc 文件: "$HOME/.vimrc"

      用户 exrc 文件: "$HOME/.exrc"

         $VIM 预设值: "/usr/local/share/vim"

可以清楚的看到,已经支持多字节。尝试打开含有中文的文件,一切正常。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值