1.卸载自带vim
yum remove vim -y
2.下载vim源代码
wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2 wget ftp://ftp.vim.org/pub/vim/extra/vim-7.2-extra.tar.gz wget ftp://ftp.vim.org/pub/vim/extra/vim-7.2-lang.tar.gz
3.解压缩
tar jxvf vim-7.4.tar.bz2 tar zxvf vim-7.2-extra.tar.gz tar zxvf vim-7.2-lang.tar.gz
4.移动7.2的插件到7.4目录
mv vim72 vim74
cd vim74/src
4.1 跳过前面4个步骤,直接
yum install git -y git clone https://github.com/vim/vim.git
cd vim
5.安装编译环境
yum -y install ncurses-devel lua-devel python-devel perl-devel ruby-devel perl-ExtUtils-Embed /usr/bin/perl -e 'unless ( $] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$_ $_\n" }}' > auto/if_perl.c /usr/bin/perl /usr/share/perl5/vendor_perl/ExtUtils/xsubpp -prototypes -typemap /usr/share/perl5/ExtUtils/typemap if_perl.xs >> auto/if_perl.c
6.编译并安装vim
./configure --with-features=huge \ --enable-luainterp=yes \ --enable-rubyinterp=yes \ --enable-pythoninterp=yes \ --enable-python3interp=yes \ --enable-perlinterp=yes \ --enable-multibyte \ --enable-sniff \ --enable-fontset \ --enable-xim \ --enable-cscope \ --with-python3-config-dir=/root/.pyenv/versions/3.5.1/lib/python3.5/config-3.5m \ --prefix=/opt/vim74 make && make install echo 'export PATH="/opt/vim74/bin:$PATH"' > /etc/profile.d/vim.sh echo "alias vi='vim'" >> /etc/profile.d/vim.sh source /etc/profile
所有评论(0)