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 ]
- Automatic generation of a tags file for the current source file by building a tree of included files.
- Listing members (also inherited ones) of a class
For QString s; s. only non-static members are suggested, for QString:: only static ones.
- Listing all function signatures of overloading methods
- Recognizes return values of methods.
QWidget w; w.rect().topLeft(). // List completions for a QPoint
- Uses the scope of the cursor position
Recognizes, if you are inside a method-definition and completes also private or protected variables for this class. For a global scope, only public members are suggested.
- Works in both console and graphical vim
- Uses a cache system for increased speed.
- Full Namespace support
For a more complete overview about available features, current shortcomings and technical details, have a look at this paper: codecompletion.pdf
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:
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
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:
- /etc/icomplete.conf
- $HOME/.icompleterc
- ./.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
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:
- After ".", "->" or "::" it shows class and struct members for the expression left to one of these tokens.
- Immediately after "(" (without any space after the bracket) it will show/complete all overloaded members of a function.
- For all other positions it will list global functions, #define macros, enumerators,... .
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.
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)
- Why the name?
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.
- Do you accept patches?
Of course, actually I am very pleased if I receive some well written patches or even modules for new languages.
- Do you accept donations?
Sure, who doesn't like donations :)
Please contact me via e-mail for information how you can donate me some money/postcards/toys/...
- Icomplete is fast in command line mode, but slow when used in vim
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.
- Compilation fails on Unices without bash
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.
- Why do you override the completion function for C code which is already in standard vim distributions?
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
- The build system is so fast and looks very good. Where do you have it from?
It was written entirely by Timo Hirvonen, and can be found here.
IComplete was written by Martin Stubenschrott.
It is covered under the GPL License.
Thanks a lot to sourceforge for hosting this project:

Last update: 2006-05-11