Clang Complete

From the Linux and Unix Users Group at Virginia Teck Wiki
Revision as of 05:33, 13 September 2012 by imported>Wyreshark (Installation)
Jump to: navigation, search

Clang Complete

Clang Complete is an addon to the popular text editor vim. It allows the user to use clang to do a lightweight compile/parse of their code, in order to allow extremely accurate code autocompletion. Alternatives out there (gcc_complete/ctags) either use hackish methods (modified compilers) or do manual parsing of the file. Clang was built with ease of IDE integration built-in, so Clang Complete simply builds on that feature.

Installation

The installation of Clang Complete requires a version of vim that supports python(3) addons. At the moment, Arch Linux's default vim build lacks the ability to use python extensions, and gvim lacks support for python3. In order to check if your vim install supports these, do:

vim --version | grep -i python

If you get a result and it contains the following, you can skip reinstalling python. Otherwise, you have to reinstall vim. (Note: if you see this with -, as in -python/dyn -python3/dyn, you have to reinstall)

+python/dyn +python3/dyn

Now we get to recompile vim from source. If you have a fun distro-specific tool such as ABS, feel free to use that. Otherwise, pull the sources from [[[1]]] and follow along.

You can compile/install vim as usual. The sole special thing that need be done for this compilation is that, when you call ./configure, you *need* to ensure the following flags are present:

--enable-python3interp --enable-pythoninterp

and the following are absent

--diable-python3interp --disable-pythoninterp

Otherwise Clang Complete will fail.


Work in progress