Skip to content

Instantly share code, notes, and snippets.

@sevko
Last active January 24, 2024 19:25
Show Gist options
  • Save sevko/870123c1c54cbd6661fc to your computer and use it in GitHub Desktop.
Save sevko/870123c1c54cbd6661fc to your computer and use it in GitHub Desktop.
Compile a full-featured Vim (w/ Python, Ruby, etc.).

compile full Vim

The default Vim installed on most Linux distros lacks a number of vital features, like xterm_clipboard (allows copy-and-pasting to the system clipboard) and python (on which certain plugins rely). The compile_full_vim.sh shell script removes the currently installed Vim and compiles a full-featured version; it's based entirely off Valloric's YouCompleteMe walkthrough, which it bundles into a simple script for convenience. Vim will be compiled with the following feature flags:

  • --with-features=huge
  • --enable-multibyte
  • --enable-rubyinterp
  • --enable-pythoninterp
  • --enable-perlinterp
  • --enable-luainterp
  • --enable-gui=gtk2
  • --enable-cscope

Note that it's written for anything Debian-like. See the original walkthrough for help with other distros.

#! /bin/bash
# Description:
# Compile a full-featured Vim from source on Ubuntu/Debian distros. Based
# entirely on
# https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source
#
# Use:
# ./compile_full_vim.sh
main(){
echo "y" | sudo apt-get remove \
vim \
vim-runtime \
gvim \
vim-tiny \
vim-common \
vim-gui-common
echo "y" | 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 ruby-dev \
mercurial
cd ~
hg clone https://code.google.com/p/vim/
cd vim
./configure --with-features=huge \
--enable-multibyte \
--enable-rubyinterp \
--enable-pythoninterp \
--with-python-config-dir=/usr/lib/python2.7/config \
--enable-perlinterp \
--enable-luainterp \
--enable-gui=gtk2 \
--enable-cscope \
--prefix=/usr
make VIMRUNTIMEDIR=/usr/share/vim/vim74
sudo make install
}
main
@xahon
Copy link

xahon commented Sep 16, 2018

git clone [email protected]:vim/vim.git --depth=1

@midnqp
Copy link

midnqp commented Mar 10, 2021

On Debian 11, apt couldn't locate package: libgnome2-dev libgnomeui-dev libbonoboui2-dev. The libraries were available until Debian 9.

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