

Set omnifunc=syntaxcomplete#Complete " override built-in C omnicomplete with C++ OmniCppComplete plugin For better usability of OmniCppComplete, put these in your. By default, Vim will search for tags file beginning from current directory to all parent directories. ctags -R -languages=C,C++ -c++-kinds=+p -fields=+iaS -extra=+q. This can be done from any subdirectory too (for even more focused tags file). To build a ctags tags file, give the command from the top directory of the project. This tags file is used by Vim and OmniCppComplete script to provide contextual data in a pop-up menu. Ctags will generate a “tags” file which is like an index of the project source code.

This is where ctags comes in to the picture. Vim is an excellent editor, but does not understand C/C++ natively. Most popular Linux distros bundle GNU ctags, but exuberant ctags should be available from the repository. But what we need is exuberant ctags which is different from GNU ctags. OmniCppComplete and SuperTab are Vim scripts, detailed installation steps are given in the respective links.
Vim supertab context omni install#
Install all 4 by whatever means (apt-get, yum, build from source). Īs you can see, it can show all methods and variables including its original context like type, prototype (in case of method), documentation (if documented), private/protected/public, file defined in etc.įor getting Vim to work like this, you will need Here is a screenshot of Omni Complete displaying the class scope in CCCC code base. It can show a pop up menu displaying the structure, class or scope context. This feature is similar to IntelliSense in Visual Studio or other IDEs. Vim 7 onwards, we have Omni Complete feature.
Vim supertab context omni software#
