Skip to content

Instantly share code, notes, and snippets.

@ax-vasquez
Last active November 1, 2022 17:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ax-vasquez/6673ae75a34b9ea150fbde66ef394521 to your computer and use it in GitHub Desktop.
Save ax-vasquez/6673ae75a34b9ea150fbde66ef394521 to your computer and use it in GitHub Desktop.
Building Vim from source

The information here was inferred from the link in this section title; the steps in this guide differ slightly from the source article. These steps are meant for users with a "default" vim runtime directory.

  1. Delete old version of Vim (refer to doc on the right way to do this - it's easy)
  2. Clone the vim repo locally, if you haven't already
  3. Run the "configure command" shown below
  4. Run the "install command" shown below

If you haven't already, check the source documentation in the title of this Gist - THIS GUIDE IS ONLY MEANT TO SUPPLEMENT THE ORIGINAL GUIDE. See the source documentation for more in-depth instructions with explanations.

Configure command

Run this from within the root of the vim directory

./configure --with-features=huge \
            --enable-multibyte \
            --enable-rubyinterp=yes \
            --enable-python3interp=yes \
            --with-python3-config-dir=$(python3-config --configdir) \
            --enable-perlinterp=yes \
            --enable-luainterp=yes \
            --enable-gui=gtk2 \
            --enable-cscope
  • How does this differ from the source docs?
    • There is no --prefix flag
    • The make VIMRUNTIMEDIR call has been excluded (you only need this if your vim runtime directory is in a non-default location)

Install command

Run this command from within the root of the vim directory

sudo apt install checkinstall
cd ~/vim
sudo checkinstall
  • You'll be asked to provide some responses before it gets rolling
    • Say "no" when asked if you want to list files
    • Say "yes" when the prompt says it's a good idea (it will literally say "saying 'yes' is a good idea" in the prompt message)
  • This process may take several minutes to complete
@ax-vasquez
Copy link
Author

ax-vasquez commented Dec 30, 2020

Follow this guide if:

  1. You followed the YouCompleteMe guide
  2. After finishing the YouCompleteMe guide, you found that, after logging out and back in, Vim's version was reverted to an older version
    • Their docs do mention that they use a non-default install directory, which why your system may be reverting to an old version of Vim
      • It's not apparent to less-experienced users that this is why the revert is happening

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment