View on GitHub my gravatar

Gustave Paté's Hideout

Python, Linux, Stuff from outer space

Compiling vim with python and system clipboard support on Ubuntu

10 Oct 2013

post banner
A quick Howto compile vim for python and system clipboard support

Edit 2014-04-16: added configure option for compilation without x

Here is a quick reminder of how-to compile vim for: * python support * ruby support * x11 copy / paste

It will be install in /usr/local/bin by default.

Don’t forget to adjust the values of the configure command for:

  • --with-compiledby
  • --with-python-config-dir
  • --with-ruby-command

Get dependencies

Run this if you are using Ubuntu otherwise adapt it to your package manager.

1
2
3
4
5
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 libncurses-dev \
    libgnome2-dev vim-gnome libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \
    libcairo2-dev libx11-dev libxpm-dev libxt-dev python python-dev ruby ruby-dev

Fetch the source

1
2
3
4
5
6
mkdir ~/vim
cd ~/vim
git clone https://github.com/b4winckler/vim
cd vim/src
make distclean
cd ..

Configure

1
2
3
4
5
6
7
./configure --with-features=huge --enable-gui=gnome2 --enable-pythoninterp=yes \
    --enable-rubyinterp=yes --enable-cscope --enable-gui=auto \
    --enable-gtk2-check --enable-gnome-check \
    --enable-fail-if-missing --enable-multibyte --enable-fontset \
    --with-x --with-compiledby="GustavePate" \
    --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/ \
    --with-ruby-command=/usr/bin/ruby

OR without X support

1
2
3
./configure  --with-features=huge --enable-pythoninterp=yes -enable-rubyinterp=yes  -enable-cscope --enable-fail-if-missing --enable-multibyte
--enable-fontset -with-compiledby="GustavePate" --with-python-config-dir=/usr/lib/python2.7/config/ --with-ruby-command=/usr/bin/ruby --disable-gui
--without-x

then

1
2
make
sudo make install

Check installation

1
2
3
4
5
#check if your tailor made vim is called first (should display /usr/local/bin/vim
which vim

#if your /usr/local/bin has not precedence on /usr/bin
sudo update-alternatives --install /usr/bin/vim vim /usr/local/bin/vim
  • Category:
  • linux
  • Tags:
  • vim
  • python
  • clipboard
  • compile
  • howto
comments powered by Disqus