vim 中文乱码的解决(适用于ubuntu和RHEL5)(转)

打开.vimrc文件

ubuntu系统中在/etc/vim/.vimrc,RHEL系统在/etc/vimrc

在其中加入

set fileencodings=utf-8,gb2312,gbk,gb18030
set termencoding=utf-8
set encoding=prc

保存退出,此时vim就能正确显示中文了。

如果想详细了解vim中的编码,可以参考一下这篇文章

http://hi.baidu.com/tpxc/blog/item/4649defccf5bef83b901a0da.html

原文地址:https://www.cnblogs.com/woainilsr/p/2691143.html