Ubuntu – Upgrade vim/gvim on Ubuntu 12.04

compilinggvim

Ubuntu 12.04 has vim 7.3.429, which has an issue with match() function, because of it I need to upgrade vim and gvim.

I need for vim >= 7.3.829 && <= 7.3.1268, or >= 7.4.018 (because of another issue)

I tried to look for PPAs, but this one has 7.4.005, which is buggy too (see version requirements above), and this one, which seems fine, but after I've done this:

sudo apt-add-repository ppa:dgadomski/vim-daily
sudo apt-get update
sudo apt-get install vim

It returns that vim is already newest version. (my actual Vim version is 7.3.429). Why is that? I also tried to remove vim and install it again, but newly installed version is 7.3.429 again.

Then I tried to build it from source, so I've cloned mercurial repo, configured and installed it:

cd ~/projects
hg clone https://vim.googlecode.com/hg/ vim
cd vim/src
./configure --enable-rubyinterp=yes --enable-pythoninterp=yes --enable-gui=gtk2 --with-x --prefix=/opt/vim
make
sudo checkinstall --pkgname=vim-my-latest

So I have vim 7.4.227 in the /opt/vim/bin now, but there's no gvim, and when I start vim and check has('gui') and has('ruby'), both of them return 0. Why is that? I've given --enable-rubyinterp=yes and --enable-gui=gtk2 --with-x. Have I missed something?

Best Answer

Done, after all.

Install libs that are necessary for gui:

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

Install lib that is necessary for ruby:

sudo apt-get install ruby-dev

Clone the repo (here I clone it in ~/projects/vim ) :

cd ~/projects
hg clone https://vim.googlecode.com/hg/ vim

Remove existing vim packages:

sudo apt-get remove vim-gtk vim vim-runtime vim-gui-common

Build, create deb package and install it:

cd ~/projects/vim/src
make distclean
./configure --with-features=huge  --enable-pythoninterp  --enable-rubyinterp  --enable-gui=gnome2 --prefix=/usr/local -with-python-config-dir=/usr/lib/python2.7/config
make
sudo checkinstall --pkgname=vim-my