sponsor Vim development Vim logo Vim Book Ad

cppnav : C/C++ File navigation - using omnicppcomplete

 script karma  Rating 39/12, Downloaded by 2832  Comments, bugs, improvements  Vim wiki

created by
Sureshkumar Manimuthu
script type
The "cppnav" is a source code navigation plugin for c++ and c files. It uses omnicppcomplete  plugin and ctag tool.

- Accurate navigation
- Jumping to member function and member variable of class/struct
- Nested jumping : ctrl-] from a jumped location goes to the next instance. ctrl-t brings back to the original locaiton
- Jumping to files in #include directive
- Prototype preview of functions, macros and variables with single key press
- Function prototype preview while typing the functionName(
- Tab based navigation
      If the identifier is declared in a file in other tab then it jumps
      to the tab instead of opening it in the current window.
   let g:cppnav_tab = 'never'
   Disable tab navigation feature

   let g:cppnav_tab = 'always'
   Always use tab navigation. Open a new tab if the file is not already opened

   let g:cppnav_tab = 'only'
   Use tab navigation only if the file is already open in another tab or the  current file is not saved.
  create the 'tags' file using ctag with following options
   --fields=+iaS --extra=+fq
  ctrl-]  = Jump to declaration
  ctrl-t  = Jump back from declaration
  <space> = Quick prototype preview (editor bottom)
  _       = Preview the declaration file (preview window)
  -       = Jump to the declaration file (preview window)

Check out the Projx plugin for automatic tag creation and project file management
install details
Install omnicppcomplete plugin from

Linux/Unix/Cygwin : copy the cppnav.vim to ~/.vim/plugin/ directory
Windows : copy the cppnav.vim to %HOME%\vimfiles\plugin\ directory

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
cppnav.vim 1.3 2013-11-30 7.0 Sureshkumar Manimuthu Nested jump : If ctrl-] pressed again from the jumped location, it jumps to the next instance
cppnav.vim 1.2 2013-11-26 7.0 Sureshkumar Manimuthu - Function prototype preview while typing functionName(
- Fixed : Prototype preview on the same file that is modified having issue
cppnav.vim 1.1 2013-11-21 7.0 Sureshkumar Manimuthu Tab based navigation support added.
Use g:cppnav_tab variable to control the behavior
cppnav.vim 1.0 2013-11-08 7.0 Sureshkumar Manimuthu Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
Vim at Github