title: Autocompletion in Vim
body: <p>In a nutshell, I'm searching for a <strong>working</strong> autocompletion feature for the Vim editor. I've <a href="https://stackoverflow.com/questions/24109/c-ide-for-linux/24119#24119">argued before</a> that Vim completely replaces an IDE under Linux and while that's certainly true, it lacks one important feature: autocompletion.</p>
  
  <p>I know about <kbd>Ctrl</kbd>+<kbd>N</kbd>, <a href="http://ctags.sourceforge.net/" rel="noreferrer">Exuberant Ctags integration</a>, <a href="http://vim-taglist.sourceforge.net/" rel="noreferrer">Taglist</a>, <a href="http://www.vim.org/scripts/script.php?script_id=527" rel="noreferrer">cppcomplete</a> and <a href="http://www.vim.org/scripts/script.php?script_id=1520" rel="noreferrer">OmniCppComplete</a>. Alas, none of these fits my description of “working autocompletion:”</p>
  
  <ul>
  <li><strong><kbd>Ctrl</kbd>+<kbd>N</kbd></strong> works nicely (only) if you've forgotton how to spell <code>class</code>, or <code>while</code>. Oh well.</li>
  <li><strong>Ctags</strong> gives you the rudiments but has a lot of drawbacks.</li>
  <li><strong>Taglist</strong> is just a Ctags wrapper and as such, inherits most of its drawbacks (although it works well for <em>listing</em> declarations).</li>
  <li><strong>cppcomplete</strong> simply doesn't work as promised, and I can't figure out what I did wrong, or if it's “working” correctly and the limitations are by design.</li>
  <li><strong>OmniCppComplete</strong> seems to have the same problems as cppcomplete, i.e. auto-completion doesn't work properly. Additionally, the <code>tags</code> file once again needs to be updated manually.</li>
  </ul>
  
  <p>I'm aware of the fact that not even modern, full-blown IDEs offer good C++ code completion. That's why I've accepted Vim's lack in this area until now. But I think a fundamental level of code completion isn't too much to ask, and is in fact required for productive usage. So I'm searching for something that can accomplish at least the following things.</p>
  
  <ul>
  <li><p><strong>Syntax awareness</strong>. cppcomplete promises (but doesn't deliver for me), correct, scope-aware auto-completion of the following:</p>
  
  <pre><code>variableName.abc
  variableName-&gt;abc
  typeName::abc
  </code></pre>
  
  <p>And really, anything else is completely useless.</p></li>
  <li><p><strong>Configurability</strong>. I need to specify (easily) where the source files are, and hence where the script gets its auto-completion information from. In fact, I've got a Makefile in my directory which specifies the required include paths. Eclipse can interpret the information found therein, why not a Vim script as well?</p></li>
  <li><p><strong>Up-to-dateness</strong>. As soon as I change something in my file, I want the auto-completion to reflect this. I do <em>not</em> want to manually trigger <code>ctags</code> (or something comparable). Also, changes should be <em>incremental</em>, i.e. when I've changed just one file it's completely <em>unacceptable</em> for <code>ctags</code> to re-parse the whole directory tree (which may be huge).</p></li>
  </ul>
  
  <p>Did I forget anything? Feel free to update.</p>
  
  <p>I'm comfortable with quite a lot of configuration and/or tinkering but I don't want to program a solution from scratch, and I'm not good at debugging Vim scripts.</p>
  
  <p>A final note, I'd really like something similar for Java and C# but I guess that's too much to hope for: <code>ctags</code> only parses code files and both Java and C# have huge, precompiled frameworks that would need to be indexed. Unfortunately, <a href="http://greengoo.de/243/developing-dotnet-without-an-ide" rel="noreferrer">developing .NET without an IDE</a> is even more of a PITA than C++.</p>