解决VIM编辑器中文乱码

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决VIM编辑器中文乱码相关的知识,希望对你有一定的参考价值。

追加如下内容到/etc/vimr (或者不同的用户家目录下的.vimrc文件中)

 

set encoding=utf8
filetype plugin indent on
syntax on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with ‘>‘, use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab

 

上边的内容中还有设置缩进的选项

以上是关于解决VIM编辑器中文乱码的主要内容,如果未能解决你的问题,请参考以下文章

linux下vim编辑器中文乱码

解决securecrt连接centos使用VIM编辑中文时乱码

Debian 7解决VIM中文乱码

Linux 下 vim 编辑文件,解决中文乱码,设置Tab键空格数

vi/vim输入中文乱码,无法输入中文解决方法

linux文本编辑乱码问题处理