【vim安装】
git clone https://github.com/vim/vim.gitcd vim/src ./configure --prefix=/usr/local/vim --enable-multibyte
#--enable-multibyte开启多字符编码,必选,不然VIM中文乱码。
make
make install
使用VIM7.4替换自带的VIM7.2:
alias vim='/usr/local/vim/bin/vim'
如果你想给每一位用户都生效的别名,请把alias vim='/usr/local/vim/bin/vim' 一行加在/etc/bashrc最后面,bashrc是环境变量的配置文件 /etc/bashrc和~/.bashrc 区别就在于一个是设置给全系统一个是设置给单用户使用.
或删除系统自带的VIM:
rpm -e vim-enhanced
.vimrc
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8 set encoding=utf-8