sponsor Vim development Vim logo Vim Book Ad

template file loader : Loads a template file and does customizable processing when editing a new file.

 script karma  Rating 123/44, Downloaded by 5014  Comments, bugs, improvements  Vim wiki

created by
scott urban
script type
This plugin is for loading template files when editing new files.  A template file will be loaded if found, keywords in that template are expanded, and/or a customized function for that type of files is called.

For all new files, the script checks to see if you have a skeleton (template) file for the extension of that file.  For example, ":new temp.c"  would check for the existence of "skel.c".  Files without extensions are handled also - if you did ":new makefile", the script checks for the existence of "skel.noext.makefile".

skel.* files are looked for in a directory specified with the environment variable $VIMTEMPLATE or in your ~/.vim directory if that env var doesn't exist.  This allows you to use mutliple sets of template files - some for work files and some for personal files, for example.

This plugin is meant to be customized - add your own keywords for expansion or your own file specific template functions (example provided in script).

The script includes many example skel.* files - some are links to others.

install details
1 - Un-gzip
2 - Un-tar in $HOME/.vim or equivalent.
3 - Plugins must be turned on.
4 - Customize as you see fit

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
templatefile-1.5.tar.gz 1.5 2002-02-23 6.0 Ľubomír Host Patched little bug in Makefile.
template.gz 1.2 2002-02-05 6.0 Ľubomír Host Completely rewrited. I include this plugin to my vimconfig project:
templatefile.tar.gz 1.0 2002-02-02 6.0 scott urban Initial upload
ip used for rating:

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