Ⅰ. 插件描述
CMake plugin for vimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'luchermitte/lh-cmake'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'luchermitte/lh-cmake'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'luchermitte/lh-cmake'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/luchermitte/lh-cmake
Ⅳ. 文档说明
lh-cmake : A CMake plugin for vim
This plugin provides a few utilities for working on CMake projects from
vim.
Features
Obtain current project configuration as it's known by CMake
This plugin can analyze the current CMakeCache.txt (seelh#btw#compilation_dir()) and report miscellaneous
information:
- Where the
CMakeCache.txtfile is thanks tolh#cmake#_where_is_cache() - The dictionary (
:h Dict) of variables matching a REGEX pattern with
lh#cmake#get_variables(*pattern*) - The list of project specific includes (it lists the content of all CMake
XXX_INCLUDEvariables)
It also provides a :CMake command that takes different parameters:
:CMake where-is-cachedisplays the location of the currentCMakeCache.txt;:CMake open-cacheopens the currentCMakeCache.txt;:CMake show patterndisplays the cached CMake variables that have a name
that matches the REGEX pattern
CMake dictionary
lh-cmake provides (an extremly incomplete) dictionary of CMake keywords,
variables, ... that can be used to help Vim complete in CMake files.
Installation
This plugin will best installed with
Vim-Addon-Manager as it will
also install
dependencies (lh-vim-lib).
By the mean time, you can clone this repositoriy and lh-vim-lib and install
them manually or with your prefered plugin manager.
Configuration
This plugin needs the variable (bpg):BTW.compilation_dir to be set to the
directory where ccmake has been executed. Having this variable set and
up-to-date can be automated thanks to
BuildToolsWrapper and
local_vimrc.
More on the subject latter.
