Vim 8 was announced in September 2016 and I have decided to compile it from the source. The default config does not include Python support and some of my plugins require this.
The most thorough guide I have found is in the Wiki for the Vim plugin YouCompleteMe. However, I had to make a few tweaks to make it work.
First off, clone the Vim repository with
git clone https://github.com/vim/vim.git
configurescript. To enable Python support the “Python config dir” is needed. On one computer,
$ which python /usr/bin/python
/usr/lib/python2.7/config-x86_64-linux-gnu. On another computer where the Anaconda distribution is used,
$ which python /usr/local/anaconda/bin/python
/usr/local/anaconda/lib/python2.7/config. You cannot use both Python 2 and Python 3, so I go for Python 3.
On the Linux Mint distribution I end up with the following options:
./configure --with-features=huge \ --enable-multibyte \ --enable-rubyinterp=yes \ --enable-python3interp=yes \ --with-python3-config-dir=/usr/lib/python3.4/config-3.4m-x86_64-linux-gnu \ --enable-perlinterp=yes \ --enable-luainterp=yes \ --disable-gui \ --enable-cscope \ --prefix=/usr/local
The “prefix” option is explained by
make installwill install all the files in
/usr/local/libetc. You can specify an installation prefix other than
--prefix, for instance
--prefix is actually superfluous, but I keep it here for reference.
After the configure script has completed the actual compilation can commence. I did this in two steps:
make sudo make install
make install copies the binary to
$PREFIX/bin and the
runtime dir to
$PREFIX/share/vim/vim80 (and probably other things).
To verify that the desired features are enabled, run
vim --version and make sure there is a “+” in front of these features.
On YouCompleteMe’s Wiki it is mentioned that the
VIMRUNTIMEDIR should be set in the first
As a side note,
VIMRUNTIMEDIR is the directory Vim use for a lot of run time configuration like syntax highlighting as explained e.g. here.
It worked for me to perform the first compilation with
make VIMRUNTIMEDIR=/home/robert/vim/runtime sudo make install
make installa large part of the output consists of copying the runtime directory to