Skip to content

nadult/vim-cpp-opener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

vim-cpp-opener: C/C++ project navigator in Vim

Video

Features

  • Instantly open files (or switch to already opened ones) by typing only part of the name which is unique to it
  • Ability to open .cpp and .h file side-by-side
  • Doesn't display any kind of lists, file is opened immediately

How matching works

  • Plugin uses git to find all files in current project (Plugin also works for projects which don't use git only not as well)

  • First it tries to find a match within tracked files (within sub-modules as well) If no matches were found, it looks within untracked files If still no matches were found, then it looks within ignored files

  • TODO: how matching & ranking works

How to use

The easiest way to install it is through Vundle. Here is an example: (excerpt from .vimrc, using Vundle):

Plugin 'nadult/vim-cpp-opener' 
map <C-Z> :CppCloseFile<CR>
map <C-X> :CppOpenFile 
map <C-A> :CppGotoFile<CR>

Now after pressing Ctrl+X and typing 'myclass' in hypothetical project, the plugin will open MyClass.h and MyClass.cpp side by side.

TODO: write better description

Additional info

For big projects with tens of thousands of files, search might become slow. In that case you can restrict the plugin to search through selected directories. This can be done by adding .vim_cpp_project file. Here is an example:

include/
src/
deps/sub_project1/
deps/sub_project2/

-build
-moc

This configuration file also contains some filters: all the files which contain 'build' or 'moc' in their full path name will be ignored.

License

This plugin is licensed under Boost Software License. See license.txt .

TODO

  • Prioritize main file name over directory names (pages/aa, page.cpp; 'page' -> page.cpp)

About

Vim plugin for quick navigation within C++ projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published