First, install all the prerequisite libraries, including Git. For a debian-like Linux distribution like Ubuntu, which would be the the following:
sudo apt-get install Libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev Libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev python3-dev ruby-dev lua5.1 lua5.1-dev Libperl-dev Git
On Ubuntu 16.04, are the liblua5.1-dev
Lua Dev package name not lua5.1-dev
.
(If you know-languages you'll be using, feel-leave out packages you won ' t need, e.g. Python2 python-dev
or Ruby . This principle heavily applies to the whole page.)
For Fedora, which would be the following:
sudo yum install-y Ruby ruby-devel lua lua-devel luajit luajit-devel ctags git python python-devel python3 python 3-devel tcl-devel perl perl-devel perl-extutils-parsexs perl-extutils-xspp perl-extutils-cbuilder Perl-extutils-embed
This step was needed to rectify a issue with how Fedora installs XSUBPP:
Once everything is installed, getting the source was easy.
Note:if you is using Python, your config directory might has a machine-specific name (e.g. config-3.5m-x86_64-linux-gnu
). Check in/usr/lib/python[2/3/3.5] to find yours, and change the python-config-dir
and/or python3-config-dir
arguments accordingly.
Note for Ubuntu 14.04 (trusty) users:you can only use Python 2 or Python 3. If you try the compile vim with both python-config-dir
python3-config-dir
and, it'll give you an error YouCompleteMe unavailable: requires Vim compiled with Python (2.6+ or 3.3+) support
.
Add/remove the flags below to fit your setup. For example, you can leave out enable-luainterp
if you don ' t plan on writing any Lua.
Also, if you ' re not using VIM 8.0, make sure to set the Vimruntimedir variable correctly below (for instance, with VIM 8.0 A, use/usr/share/vim/vim80a). Keep in mind that some VIM installations is located directly Inside/usr/share/vim; Adjust to fit your system:
~git Clone https://github.com/vim/vim.gitcd vim./configure--with-features=huge --enable-multibyte -- Enable-rubyinterp=yes --enable-pythoninterp=yes --with-python-config-dir=/usr/lib/python2.7/config --enable-python3interp=yes --with-python3-config-dir=/usr/lib/python3.5/config -- Enable-perlinterp=yes --enable-luainterp=yes --enable-gui=gtk2 --enable-cscope --prefix=/ Usr/localmake Vimruntimedir=/usr/local/share/vim/vim80
On Ubuntu 16.04, Python support is not working due to enabling both Python2 and Python3. Read answer by Chirinosky for workaround.
In practice, Python2 and Python3 is not working at the same time on Ubuntu 14.04.5 LTS. Choosing one of them is OK.
If you want to is able to easily uninstall vim use checkinstall
.
sudo apt-get install checkinstall~/vimsudo checkinstall
Otherwise, you can use the to make
install.
~/vimsudo make Install
Set Vim as your default editor with update-alternatives
.
sudo update-alternatives--install/usr/bin/editor editor/usr/bin/vim 1sudo update-alternatives--set editor/usr/bin/ Vimsudo update-alternatives--install/usr/bin/vi vi/usr/bin/vim 1sudo update-alternatives--set Vi/usr/bin/vim
Double Check that is in fact running the new Vim binary by looking at the output of vim --version
.
If you don ' t get gvim working (on Ubuntu 12.04.1 LTS), try changing to --enable-gui=gtk2
--enable-gui=gnome2
If you have a problems, double check that you configure
d using the correct Python config directory, as noted at the beginning of Step 3.
These configure
make
and calls assume a debian-like distro where Vim ' s Runtime files directory /usr/share/vim/vim80/
is placed in, which is n OT Vim ' s default. Same thing goes for on the call --prefix=/usr
configure
. Those values may need to being different with a Linux distro that's not based on Debian. In such a case, try-to-remove --prefix
the variable configure
in the "call" VIMRUNTIMEDIR
make
and the "the" in the "the" and the "the" in the words, go wit h the defaults).
If you get the stuck, here's some other useful information on building Vim.