CMake-Project is a plugin for cmake projects effective management.
This is a fork of https://github.com/Ignotus/vim-cmake-project The intention was to provide minor changes, but I ended up with complete rewrite of the project. It depends on others (optional) plugins, like NERDTree and Vimux.
vim-cmake-project has following features:
- Project is activated only by opening cmake project file: "CMakeLists.txt". Project file "CMakeLists.txt" do not have to be in the current working directory. I.e "vim ~/prg/cplus/test/CMakeLists.txt". All above described commands will be available for the use.
- Project provides two additional windows: a) project files on the sidebar (using NEDRTree plugin). Project files are filtered, so it only C++/C files and txt files will be shown. b) output window - bottom window pane (using Vimux plugin). It will display output by executing commands.
- Commands for building makefiles, compiling project, cleaning generated binaries and toggling project windows/panes.
- Customizable mapping keys/shorcuts
Install NERDTree and Vimux plugins (optional):
https://github.com/scrooloose/nerdtree
https://github.com/benmills/vimux
Install vim-cmake-project. If you don't have a preferred installation method, I recommend installing pathogen.vim, and then simply copy and paste:
cd ~/.vim/bundle
git clone git://github.com/sigidagi/vim-cmake-project.git
Or for Vundle users:
Add Plugin 'sigidagi/vim-cmake-project' to your ~/.vimrc and then:
either within Vim: :PluginInstall
or in your shell: vim +PluginInstall +qall
Open "cmake" project file "CMakeLists.txt" with vim. CMake project file not necessary have to be in current working directory.
You can generate native makefiles and workspaces by this command:
:CMakeBuild
Compile project
:CMakeCompile
Clean project - remove binary files generated by cmake
:CMakeClean
If project is running on "tmux" all outputs are provided in separate window/pane. Output window will open as soon as above commands are executed. To close output window use following command:
:CMakeOutput
To toggle sidebar window with project files issue following command:
:CMakeBar
For navigation and usage of tree list in sidebar window refer to "NERDTree" plugin help
Default key maping:
map <Leader>pb <Plug>CMakeBuild
map <Leader>pc <Plug>CMakeCompile
map <Leader>pl <Plug>CMakeClean
map <Leader>po <Plug>CMakeOutput
This product is released under the BSD License.