卸载自带vim
yum remove vim-enhanced vim-common
下载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
解压缩三个包
tar jxvf vim-7.4.tar.bz2 tar zxvf vim-7.2-extra.tar.gz tar zxvf vim-7.2-lang.tar.gz
把插件包移动到vim74主目录里
mv vim72 vim74
安装编译时需要的包
yum -y install ncurses-devel lua-devel python-devel perl-devel ruby-devel
编译安装vim
cd vim74/src ./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
安装好的效果图
编译过程中出现以下错误的解决:
Can't open perl script "/usr/share/perl5/ExtUtils/xsubpp": No such file or directory
yum -y install perl-ExtUtils-Embed
Can't open perl script "/usr/share/perl5/ExtUtils/xsubpp": No such file or directory
make: *** [auto/if_perl.c] Error 2
/usr/bin/perl -e 'unless ( $] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$_ $_ " }}' > 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
然后继续编译