Ⅰ. 插件描述
Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'funorpain/vim-cpplint'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'funorpain/vim-cpplint'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'funorpain/vim-cpplint'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/funorpain/vim-cpplint
Ⅳ. 文档说明
vim-cpplint
vim-cpplint is a Vim plugin that runs the currently open file through
cpplint.py, a static syntax and style checker for C++ source code.
Installation
Use vim-pathogen if you're not using
it already. Then, simply put the contents of this repository in your~/.vim/bundle directory.
Usage
- Open a C++ file
- Press
<F7>to runcpplint.pyon it
It shows the errors inside a quickfix window, which will allow your to quickly
jump to the error locations by simply pressing [Enter].
Customization
If you don't want to use the <F7> key for cpplint-checking, simply remap it
to another key. It autodetects whether it has been remapped and won't register
the <F7> key if so. For example, to remap it to <F3> instead, use:
autocmd FileType cpp map <buffer> <F3> :call Cpplint()<CR>
Tips
A tip might be to run the cpplint.py check every time you write a C++ file, to
enable this, add the following line to your .vimrc file (thanks
Godefroid!):
autocmd BufWritePost *.h,*.cpp call Cpplint()