yum remove vim -y
 yum install ncurses-devel python-devel -y
git clone https://github.com/vim/vim.git
cd vim/src
./configure --with-features=huge \
            --enable-multibyte \
            --enable-rubyinterp=yes \
            --enable-pythoninterp=yes \
            --with-python-config-dir=/usr/lib64/python2.7/config \
            --enable-python3interp=yes \
            --with-python3-config-dir=/usr/local/python3/lib/python3.7/config-3.7m-x86_64-linux-gnu \
            --enable-luainterp=yes \
            --enable-cscope \
            --prefix=/usr/local/vim
make
make install

 

export PATH=$PATH:/usr/local/vim/bin/

 

alias vi='/usr/local/vim/bin/vim'

 

编译参数说明:

  • [ ] –with-features=huge:支持最大特性
  • [ ] –enable-rubyinterp:打开对ruby编写的插件的支持
  • [ ] –enable-pythoninterp:打开对python编写的插件的支持
  • [ ] –enable-python3interp:打开对python3编写的插件的支持
  • [ ] –enable-luainterp:打开对lua编写的插件的支持
  • [ ] –enable-perlinterp:打开对perl编写的插件的支持
  • [ ] –enable-multibyte:打开多字节支持,可以在Vim中输入中文
  • [ ] –enable-cscope:打开对cscope的支持
  • [ ] –with-python-config-dir=/usr/lib64/python2.7/config 指定python 路径
  • [ ] –with-python-config-dir=/usr/lib64/python3.5/config 指定python3路径

查看vim 版本

vim --version