redat vi 中文乱码解决

来源:互联网 发布:fifaol317球员数据库 编辑:程序博客网 时间:2024/05/20 02:54

第一步:~/.bash_profile 尾部加入以下内容,并source ~/.bash_profile

export PATH
export LANG=zh_CN.UTF8
export LC_CTYPE="zh_CN.gbk"
export LC_NUMERIC="zh_CN.gbk"
export LC_TIME="zh_CN.gbk"
export LC_COLLATE="zh_CN.gbk"
export LC_MONETARY="zh_CN.gbk"
export LC_MESSAGES="zh_CN.gbk"
export LC_PAPER="zh_CN.gbk"
export LC_NAME="zh_CN.gbk"
export LC_ADDRESS="zh_CN.gbk"
export LC_TELEPHONE="zh_CN.gbk"
export LC_MEASUREMENT="zh_CN.gbk"
export LC_IDENTIFICATION="zh_CN.gbk"
export LC_AL=Lzh_CN.gbk


第二步:~/.vimrc中尾部加入以下内容,并source~/.vimrc

set fenc=utf-8
set encoding=utf-8
set fileencodings=utf-8,gb18030,utf-16,big5
se ttermencoding=gbk


另外一些有用的命令:

set nocompatible
set number
set history=1000
set background=dark
syntax on
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set showmatch
set guioptions-=T
set vb t_vb=
set ruler
set nohls
set incsearch