- OmniCppComplete’s GitHub repository (To avoid mixing up of files from different plugins, use a plugin management plugin like pathogen.vim or Vundle.)
- Ctags’s official homepage on SourceForge (The ZIP file for M$ Win *2**0 is fine.)
Reading the OmniCppComplete’s documentation only, you won’t be able
to understand how to use this plugin, so follow some tutorials, and
the most viewed one should be on Vim Tips Wiki.
Followed its guidance, I got error in typing
std:: in a new CPP
file. Omni completion told me something like “pattern not match”. I
spent nearly 2 hours to figure out what’s wrong, and finally managed
to fully understand the contents of this blog entry.
Now, I’m going to make a M$ Win* version of Vim Tips Wiki’s tutorial, using the ideas from Carl.
OmniCppComplete does not mix up with other plugins.
Note: For gVimPortable, do store files under the Data folder, but NOT the
$VIMRUNTIMEfile. Otherwise the settings will be lost after upgrading gVimPortable.
:h omnicppcompletein Vim normal mode gives up the help file for OmniCppComplete.
The folder for ctags is in the PATH environment variable.
Follow this page for setting the PATH variable.
C:\ctags58should be in the
Unzip the folder and place it under “somewhere meaningful to you”.
Here you can substitute
[your user name]with your real user name on M$ Win*.
Note: In the dialogue (in case you use GUI), don’t input
tagsat the end. Otherwise, you’ll get
If things go right, you should have
Go to that directory by typing
cd .vim\tags in M$ Win*’s Command
Prompt, which can be involked by typing
cmd in the “Start” menu.
(For M$ Win* XP, choose “Run” and type “cmd” in the popup dialogue.
If you like choosing from the menu, follow
the way on the official website.)
At first, a commad prompt should be like this.
The current directory is
Change the current directory to
The contents should be shown by typing
dir (There’re so many files
that I use the
/w option to save space.)
The contents are in the right place, so we may proceed.
Get a list of ctags.
To get a list of ctags, the correct command:
>ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ -f cpp .
The one you see on Vim Tips Wiki:
>ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ -f cpp cpp_src
Finally, adding the lines found in the Vim Tips Wiki into your VIMRC will do.
Note: If you don’t add the additional tags in step 5, then the following lines should NOT be added.
1 2 3
A picture can illustrate the feature well. Typing
std::, you’ll get
a popup list.
Incompatibility with clang_complete
Note that Omnicppcomplete is incompatible with another Vim plugin called clang_complete, due to its “unconditional popup of completion list”. To understand this, the following pictures give a good interpretation.
In OmniCppComplete, after typing
std::, the completion list will
However, in clang_complete, since the information is from the clang compiler, you need to give the syntax in the right position for the compiler so as to let the completion list to show up.
On Ubuntu, it’s easy to install. Note that you need
well. For M$ Win*, maybe you need to download the source. (I hope
there will be a compiled version of the compiler.)