AutoInclude


Ⅰ. 插件描述

Automatically add #include statements for c++ files

Ⅱ. 基本信息

创建日期:  2008-06-20
使用用户:  1
Github星:  1
插件作者:  Py Rho

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '/autoinclude'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '/autoinclude'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '/autoinclude'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/AutoInclude

Ⅳ. 文档说明

This script allows you to automatically add the #include statements at the top of you *.{cc,hh} files.
To use it, place the cursor on the type you need to include, then press <;;> and the corresponding #include statement will be added.
In .cc files, the correct #include is added, and in .hh files, the forward declaration is added.

Example:
void myfunc (Foo* x);
-> if you place the cursor on "Foo" and press <;;> (just the 2 semicolons), the #include "foo.hh" will be added at the top of the file. (The insertion location is specified by a variable, see Install Details).

The naming standard used is "Foo" and "FooBar", for the FooBar class the #include will be: #include "foo-bar.hh".

添加新评论