IComplete - A code completion system

IComplete is a command line program, which lists possible completions
for a certain position in a source code, reusing the excellent Exuberant-ctags program.

Currently it only works with C/C++ source code, and partly with Java and probably C# sources.
IComplete is meant to be editor-independent, so you can use it as an API browser for the command line, no matter which editor you prefer. However, I provide an integration plugin for Vim, which helps speeding up your coding sessions, especially with new APIs.

I am searching for new developers/maintainers, since I am currently working on a new firefox plugin, which will finally make using firefox feel like using Vim. So, I have no interest in maintaining icomplete anymore. Please write an email to me, if you want a sourceforge account to keep icomplete development running. Otherwise there is a new vim plugin for C++ completion which works quite well: OmniCppComplete

[ Features | ChangeLog | Download | Installation | Configuration | How to use | Screenshots | F.A.Q | Copyright ]

Features

For a more complete overview about available features, current shortcomings and technical details, have a look at this paper: codecompletion.pdf

Download

Current version 0.5
There is a corresponding entry in the vim script repository: http://www.vim.org/scripts/script.php?script_id=1265

IComplete is completely free software, however if you appreciate my work you can donate on the SourceForge account:
Support This Project

Installation

Requirements

- Linux
Probably works on other POSIX-like operating systems as well, but untested.
- Exuberant-ctags
A utility to find available functions and variables of a file
- Vim
Not a real requirement, but IComplete is much more useful when used from within vim.
Version 7.0 is required, since it provides a framework for context sensitve completions.
Now just run the normal commands:
	# ./configure
	# make
	# su
	$ make install
			
IComplete expects the exuberant-ctags program to be installed as ctags somewhere in you path. Some distributions like Gentoo or Mandrake install it as exuberant-ctags, if this is true in your case, run the ./configure command like this:
	# ./configure CTAGS_CMD=exuberant-ctags
			

Configuration

If you don't use any special libraries, you shouldn't need to configure IComplete. But if you reuse other APIs, which are not located in the current directory or /usr/include, you have the ability to add extra search paths for #include directories by adding them to the configuration files.

Configuration files are searched in these locations:

  1. /etc/icomplete.conf
  2. $HOME/.icompleterc
  3. ./.icomplete
An IComplete configuration file looks like this:
	[cpp_include_paths]
	# Specify the directories, where to search for *.h files one by line
	.
	/usr/include
	/usr/qt/3/include
	/usr/kde/3.5/include

	[cpp_macros]
	# These are passed as -IMACRO to exuberant-ctags
	# look at the exuberant-ctags man page for more information
	__attribute_pure
	__THROW
		

How to use

Command line interface

If you want to output available completions in the main.cpp file in line 13 after column 5, use this command:
	# icomplete -l 13 -c 5 main.cpp
		
If you already have a valid tags file, you can also use IComplete as an API browser. The following example lists all public members of the std::vector class:
	# icomplete -m std::vector
		
For more options look at the icomplete --help output.

Vim plugin

The vim plugin uses the new omni completion system which will standardize the way, one can use context sensitive completion systems. Therefore just write the code like you are used to, and if you need some help press Ctrl-X, Ctrl-O which will do the following: Now you can continue typing or select the next item from the list with Ctrl-N and the previous one with Ctrl-P.
For overloaded functions you may want to set g:cppcomplete_placeholders = 1 in your vimrc config file. This will put a <+ and +> around each parameter, and you can select one with Ctrl-J and Ctrl-K. Then you can just write "over" the selected portion, replacing the definition with real code. For this to work you need a working installation of the LaTeX-Suite.

Java and C# support

These languages are not officially supported by IComplete, but since the syntax is very similar to C++ and exuberant-ctags supports Java and C#, you may have luck, if you build the tags file yourself:
	# NB: the following call is untested and may not be 100% correct
	# ctags --fields=afiKmsSzn --java-kinds=cfm --language-force=java -R . /path/to/java/sdk
		
After that, you can use it in the same way as for C++ with the little difference that you should rebuild the tags file from time to time.

Screenshots

Listing (also inherited) members for the current class and scope

Showing all overloaded methods

Overloaded methods with placeholders enabled

Java support (must build tags file manually)

F.A.Q.

  1. Why the name?
  2. It's a mixture of "I complete (this code for you)" and "Insert (mode) Completion", because I didn't find a better name yet. If you have a good suggestion, please contact me via e-mail.
  3. Do you accept patches?
  4. Of course, actually I am very pleased if I receive some well written patches or even modules for new languages.
  5. Do you accept donations?
  6. Sure, who doesn't like donations :) Please contact me via e-mail for information how you can donate me some money/postcards/toys/...
  7. Icomplete is fast in command line mode, but slow when used in vim
  8. This problem was reported on HP and Sun Unices, because the default shell was '/bin/zsh'. Try putting 'set shell=/bin/sh' in your ~/.vimrc.
  9. Compilation fails on Unices without bash
  10. Unfortuately, the ./configure uses a build system which depends on bash >= 2. Calling `gcc -std=c99 *.c' should work though, at least if you have a valid getopt.h installation.
  11. Why do you override the completion function for C code which is already in standard vim distributions?
  12. Since for now, my system works better for C code like the one which is included with vim. If you don't like that, just modify the autocommand in the installed icomplete.vim file
  13. The build system is so fast and looks very good. Where do you have it from?
  14. It was written entirely by Timo Hirvonen, and can be found here.

Copyright

IComplete was written by Martin Stubenschrott.
It is covered under the GPL License.

Thanks a lot to sourceforge for hosting this project:
SourceForge.net Logo

Last update: 2006-05-11