vim 中文乱码

sudo vim /var/lib/locales/supported.d/local

添加

en_US.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8
zh_CN.GB18030 GB18030
zh_CN.GBK GBK

然后执行

sudo locale-gen

 等成功后执行

gedit /etc/vim/vimrc

  添加

  

set encoding=GBK
set fileencodings=GBK,UTF-8,GB18030,GB2312
set fileencoding=GBK
set termencoding=GBK

相关推荐