Linuxvi中文乱码处理

 

 

[root@svn~]# vi /etc/vimrc

if v:lang =~ "utf8$" || v:lang =~"UTF-8$"
set fileencodings=ucs-bom,utf-8,latin1
endif

set nocompatible " Use Vim defaults (much better!)
set bs=indent,eol,start " allow backspacing overeverything in insert mode
"set ai " always setautoindenting on
"set backup " keep a backupfile
set viminfo='20,\"50 " read/write a .viminfo file, don'tstore more
" than 50 lines ofregisters
set history=50 " keep 50 lines of command linehistory
set ruler " show the cursor positionall the time

" Only do this part when compiled with supportfor autocommands
if has("autocmd")
augroupredhat
"/etc/vimrc" 64L, 1962C
if &t_Co > 2 || has("gui_running")
syntax on
sethlsearch
endif

filetype plugin on

if &term=="xterm"
sett_Co=8
sett_Sb=^[[4%dm
sett_Sf=^[[3%dm
endif

" Don't wake up system with blinking cursor:
" http://www.linuxpowertop.org/known.php
let &guicursor = &guicursor .",a:blinkon0"

setencoding=utf-8
setfileencodings=utf-9,cp936


"/etc/vimrc" 71L, 2016C written
[root@svn ~]#
[root@svn ~]#
[root@svn ~]#
[root@svn ~]#
[root@svn~]# vim /svndata/data/中文.txt
我爱你!!!!
~

 参考文章:

​http://jingyan.baidu.com/article/93f9803f0e4598e0e46f5596.html​