Ⅰ. 插件描述
Generate C++ code templates based on the header fileⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/c-code-template-generator'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/c-code-template-generator'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/c-code-template-generator'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/Cpp-code-template-generator
Ⅳ. 文档说明
Opens a template file and replaces various tags with values that are parsed from the header file. The information parsed includes data members and their types, constructors including overloaded constructors and their parameters, methods declarations and their return types and parameter lists, as well as the class name. This is then put into the source template in the proper format. Data members are added to the constructors to relieve typing to initialize all your class variables. The destructor is also added. There is a little documentation in the ftpplugin/cpp/tmpl_gen.vim file. It describes what tags that are currently supported so you can customize the template file that is included. Feedback is needed, and very welcome. Feel free to email me with any bug reports, feature requests, or if you need help getting it set up.
NOTE! This is currently broken. I will fix it after the semester ends, but for the time being you can edit tmpl_gen.vim and change 'require "tmpl_gen.rb"' to 'require "#{ENV['HOME']}/.vim/ftplugin/cpp/tmpl_gen.rb".
I would fix this now, but I am in the middle of making some major modifications, and I have finals coming up.