Skip to content

Instantly share code, notes, and snippets.

@zz-jason
Last active October 30, 2023 02:37
Show Gist options
  • Save zz-jason/b8fa3457087c8007273329a628ccc8e6 to your computer and use it in GitHub Desktop.
Save zz-jason/b8fa3457087c8007273329a628ccc8e6 to your computer and use it in GitHub Desktop.

1. Install Dependencies:

sudo yum install git gcc gcc-c++ ncurses-devel python3 python3-devel -y

2. Clone:

git clone --depth 1 https://github.com/vim/vim ~/vim
cd ~/vim

3. Compile:

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`

4. Install:

make install

Now you should find your vim in $VIM_HOME, verify that python 3 is supported:

$VIM_HOME/bin/vim --version | grep python

5. Add it to $PATH

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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment