sudo yum install git gcc gcc-c++ ncurses-devel python3 python3-devel -y
git clone --depth 1 https://github.com/vim/vim ~/vim
cd ~/vim
git checkout v8.2.5014
export VIM_PREFIX=/opt/vim-8.2.5014
./configure --with-features=huge \
--enable-multibyte \
--enable-pythoninterp=yes \
--with-python-config-dir=`python-config --configdir` \
--enable-python3interp=yes \
--with-python3-config-dir=`python3-config --configdir` \
--enable-gui=gtk2 \
--enable-cscope \
--prefix=$VIM_PREFIX
make -j `nproc`
make install
Now you should find your vim in $VIM_HOME
, verify that python 3 is supported:
$VIM_HOME/bin/vim --version | grep python
Add these lines to you .bashrc
or .zshrc
file:
export VIM_HOME=/opt/vim-8.2.5014
export PATH=$VIM_HOME/bin:$PATH
alias vi='vim'