gvim + ibus woes / building gvim from source2013.08.11
My main development machine is running Ubuntu 12.04 and for a while now I've had issues with using gvim 7.3.x in conjunction with ibus. Specifically upon starting gvim there's a long start up latency (30s+) while the ibus daemon is running. Shutdown the ibus daemon and gvim starts up near instantly. Here is the ticket describing the issue in more detail in Launchpad.
Yesterday vim 7.4 was just released and according to the aforementioned ticket the issue was resolved in 7.3.530. Unfortunately neither vim 7.4 nor 7.3.530 are yet in the Ubuntu repos, so I decided to build 7.4 from source. Along the way I'll attempt to jot down some notes here for my future self.
I didn't know before I began, but gvim is actually built from the same src tree as vim src. Before we start, we'll need to make sure we have all the necessary development libraries required to build gvim. Ubuntu docs suggest the following command should work -- I can't say for sure as I had a lot of requisite development libraries installed as other projects I'm working on depend on them as well.
~$ sudo apt-get build-dep vim
We'll need mercurial to pull down the latest vim sources. I'm going to build the sources in my
Since I doubt I'll need the repo metadata (the included
.hg directory) so I'll remove that to reclaim a little space.
~$ sudo apt-get install mercurial ~$ cd ~/working/ ~/working$ hg clone https://vim.googlecode.com/hg/ vim ~/working$ cd vim ~/working/vim$ du -sh 139M . ~/working/vim$ rm -rf .hg ~/working/vim$ du -sh 65M .
Then to build change into the src directory and run configure with the options below. I want to build with pretty
much all the features so I'll go with the option
--with-features=huge; optionally you can use tiny, small, normal, or big
instead; a breakdown of the differences is given here. The options
of the form
--enable-XXXinterp are support for vim plugins written in XXX. The
--enable-gui=gtk2 option is
obviously for gvim support.
~/working/vim$ cd src ~/working/vim$ ./configure --with-features=huge --enable-rubyinterp \ --enable-pythoninterp --enable-perlinterp \ --enable-luainterp --enable-gui=gtk2
Once the configuration script runs without errors, we can then build with make. Note the
VMRUNTIMEDIR variable passed
to make. This is the location of default system runtime director for vim plugins, docs, dictionaries, etc... for Ubuntu.
~/working/vim$ make VIMRUNTIMEDIR=/usr/share/vim/vim73
At this point one could optionally install vim on their system using the typical
make install target. But
this feels dirty to me. Plus I prefer to keep all my development tools installed within my home directory. This makes migrating my
my development environment much less painful. So I'll define an alias in my
~/.bashrc and be good to go.
~/working/vim$ alias | grep gvim alias gvim='~/working/vim/src/vim -g -p'