How to Compile Vim
Compiling on Ubuntu
To build vim from source on Ubuntu:
- Get a copy of the source code by downloading from the official Vim repository on GitHub.
- Get the dependencies by running
$ sudo apt-get build-dep vim-gnome
or similar. - Go to the directory of the Vim source code:
cd vim/src
- Run
$ ./configure
. You can customize the build (and enable Perl, Python, etc. language integrations) by passing configuration options. Seesrc/INSTALL
for an overview. - Run
$ make
. - Finish the installation by running
$ sudo make install
. As your self-compiled Vim is not managed by the package manager, it will be placed in/usr/local/bin/vim
, instead of/usr/bin/vim
. So, to run it, you either need to specify the full path, or ensure that/usr/local/bin
is before/usr/bin
in yourPATH
(it usually is). - (Optional) Remove the distribution-provided version of Vim if you had it installed already:
$ sudo apt-get remove vim vim-runtime gvim
.
To verify the installation, you can run $ which vim
which should return something like /usr/local/bin/vim
if the installation was successful.