sponsor Vim development Vim logo Vim Book Ad

load_template : Loading templates as html,makefile,class ... and you can make template yourself!

 script karma  Rating 66/29, Downloaded by 4069  Comments, bugs, improvements  Vim wiki

created by
zhu nianyang
 
script type
utility
 
description
The plugin mainly provides the functionality that loading templates such as class,html,makefile and so on.The plugin also can load templates with script to take the replace of the filename or classname.(As default,the plugin has already included templates as main,singleton class,html,xml,makefile.)
For any question,welcome to my blog http://www.vimer.cn,
and welcome to email me:zny2008@gmail.com / dantezhu@vip.qq.com
The plugin's homepage is :
http://www.vimer.cn/2010/02/vimer-cn%e5%8e%9f%e5%88%9bvimgvim%e6%8f%92%e4%bb%b6load_template%e6%ad%a3%e5%bc%8f%e5%8f%91%e5%b8%83.html
Use guide:
1)Download load_template.vim,and put it into the plugin directory.

2)Assign the directory where to load templates in your vimrc file.
For example
let g:template_path = 'C:\template\'
Warning:Don't forget about the last '\'.

3)New/Open a test.cpp,execute
:LoadTemplate
It will show the template list like this:
Template filelist:
0 : cpp/main.cpp
1 : cpp/singleton.h
please select:

4)There are also options available that allow you to make your own templates(you can write vim script in it.)
Just try it yourself.

=================================================
该插件主要实现了自动载入各种模板的功能(如类模板,html模板,makefile模板等等),并且支持动态模版的功能,即能够通过脚本动态的实现文件名,类名的替换。(默认已经提供了简单main函数模板、单体类模板、html标准模板、xml标准模板)
欢迎来 http://www.vimer.cn  ; 来分享你的模板文件,或者直接给我
发送邮件zny2008@gmail.com/dantezhu@vip.qq.com
这个插件的主页是:
http://www.vimer.cn/2010/02/vimer-cn%e5%8e%9f%e5%88%9bvimgvim%e6%8f%92%e4%bb%b6load_template%e6%ad%a3%e5%bc%8f%e5%8f%91%e5%b8%83.html

使用说明
1)下载load_template.vim插件,并放在plugin的目录下
2)在vimrc文件中指定你的模板目录,来指定插件读取模板的目录。
如在下载包中已经带了一个template的目录,里面按照文件扩展名、文件类型,分别建立了目录,你可以将这个template文件夹复制到C:\\,那么就可以指定
let g:template_path = 'C:\template\'
注意,最后的'\'请务必不要忘记(在linux下也是一样要加 '/' )
3)新建/打开一个test.cpp,执行
:LoadTemplate
试试看,是否有类似模板列表出来啦~
Template filelist:
0 : cpp/main.cpp
1 : cpp/singleton.h
please select:
4)你甚至可以自己制作模板文件~~只需要参考已经存在的模板文件就行啦~~支持vim脚本的哦
 
install details
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
load_template.zip 1.1.0 2010-02-09 7.0 zhu nianyang new feature:
you can control the cursor's last place. you can see the main.cpp template to know more.

新特性:
现在可以控制鼠标的最后停留位置啦,你可以看一下 main.cpp这个模板来了解更多。
load_template.zip 1.0.3 2010-02-04 7.0 zhu nianyang if is windows
let the default template directory is $VIM.'\vimfiles\template'
else if linux or else
let the default template directory is $HOME.'/.vim/template/'
load_template.zip 1.0.2 2010-02-04 7.0 zhu nianyang fix the bug:
E121: 未定义的变量: g:vimrc_splitstr

E15: 无效的表达式: ‘~’.g:vimrc_splitstr.’template_source.vim’

load_template.zip 1.0.1 2010-02-03 7.0 zhu nianyang the doc file miss something...
load_template.zip 1.0 2010-02-03 7.0 zhu nianyang Initial upload
ip used for rating: 3.236.112.101

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github