Ⅰ. 插件描述
Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'tonychg/magictemplate'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'tonychg/magictemplate'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'tonychg/magictemplate'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/tonychg/magictemplate
Ⅳ. 文档说明
# Magic Template
Insert template file on new BuffEnter or Edit
Author: TonyChG
License: MIT
URL: https://github.com/tonychg/
Demo
Usage
Default templates directory you can change it with:
let g:templatesDirectory = $HOME."/Templates/"Template rely on the filename/filetype of the current buffer.
For filename related:
Create a LICENSE file in the templates directory
When you open a new LICENSE file, MagicTemplate write the file LICENSE in
the current buffer.
For filetype related:
Create a javascript file
Template are write when vim enter a new javascript file
Template Variables
You can configure substitution of template varaiables in MagicTempalte.vim
In the function WriteTemlate() execute your substitute command. 