Ⅰ. 插件描述
AutoCpp types complex C++ typenames for you.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/autocpp'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/autocpp'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/autocpp'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/AutoCpp
Ⅳ. 文档说明
USAGE
Type something like
it = mapIntToString.find(3);
then hit <C-J> (Ctrl + J). If declaration of myMap is availible inside
current function, AutoCpp will insert typename of iterator (for now
AutoCpp only supports const_iterator / iterator).
If myMap is declared in that way
std::map<int, std::string> mapIntToString;
line with iterator turns into
std::map<int, std::string>::const_iterator it = mapIntToString.find(3);
Hit <C-J> one more time and line becomes
std::map<int, std::string>::iterator it = mapIntToString.find(3);
To get an idea of how it works, you can watch a short video:
http://www.youtube.com/watch?v=uTqnQEuUSL4
SOURCE CODE
You can find all sources here:
https://github.com/9uMaH/autocpp