How can I build vim with a gui without gtk?

I've recently started playing around with pygobject. However, gvim or vim's python-complete feature crashes, because, as I understand, you cannot mix GTK2 and GTK3 libraries in the same process.

Therefore, I'd like to know how to install Vim with a non-GTK toolkit. (sudo apt-get build-dep vim will try to install gtk2 libs.)

Please note that I'm very happy with Vim, and I don't want to switch editors.

I've found instructions to build vim with qt, however python-complete is not working properly.


Solution 1:

If you built vim against Qt rather than GTK+ and python-complete still isn't working, that suggests the problem isn't actually a consequence of trying to link to both GTK+2 and GTK+3.

However, since you haven't yet provided any details about how you built with Qt (Qt isn't officially supported, so you must have used a third party derivative of vim), and you haven't provided any detailed information about what error messages or malfunctions you're having with python-complete, it's not really possible to tell you how to fix the problem and get vim working with Qt.

Fortunately, vim officially supports some GUI's other than GTK+ and Qt, and one such build is officially packaged for Ubuntu.

Just install the Athena version of vim, which is provided by the vim-athena Install vim-athena package.

You can install by clicking the package link above, or searching for it in the Software Center or Synaptic Package Manager, or running these commands:

sudo apt-get update
sudo apt-get install vim-athena

vim-athena doesn't depend on or use any version of GTK+. If you use sudo apt-get build-dep vim-athena, it probably will install GTK+ and GNOME related libraries, because the vim-athena binary package is built from the same source package as vim and other vim-providing packages. In any case, you shouldn't need to build from source, as the binaries provided by vim-athena are already built against Athena and not against GTK+ or other graphical toolkits.