Skip to content

Instantly share code, notes, and snippets.

@hxhc
Last active January 30, 2020 21:03
Show Gist options
  • Save hxhc/778d7c3a3ad491dedf3675a47275a979 to your computer and use it in GitHub Desktop.
Save hxhc/778d7c3a3ad491dedf3675a47275a979 to your computer and use it in GitHub Desktop.
Compiling Vim with Anaconda

Compiling Vim with Anaconda

Vim is a powerful editor with no doubt, and the jedi-vim plugin is powerful for pythoners. However, jedi-vim can't work with Anaconda. This is because

  • Ubuntu's (14.04) python is located at /usr/bin
  • Anaconda' python is at ~/Anaconda3/bin

There is a tricky but dangerous way to overcome it. Adding the line below to ~/.zshrc or ~/.bashrc.

export $PYTHONPATH = $PYTHONPATH:/home/user1/anaconda3/lib/python3.5/site-packages

More safely, recompiling vim is the choice.

$ git clone https://github.com/vim/vim.git
$ cd vim
$ ./configure --with-features=huge \
--enable-pythoninterp=yes \
--with-python-config-dir=/home/hxhc/Anaconda2/lib/python2.7/config \
--enable-python3interp=yes \
--with-python3-config-dir=/home/hxhc/Anaconda2/envs/py35/lib/python3.5/config-3.5m
$ sudo make
$ sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment