Ⅰ. 插件描述
CMake project management in VIMⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'sigidagi/vim-cmake-project-who-speaks'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'sigidagi/vim-cmake-project-who-speaks'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'sigidagi/vim-cmake-project-who-speaks'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/sigidagi/vim-cmake-project
Ⅳ. 文档说明
VIM-CMake-Project v0.3.0
About
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
Screenshot
Installing
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
Usage
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
License
This product is released under the BSD License.