sponsor Vim development Vim logo Vim Book Ad

templates : Load filetype templates for new files

 script karma  Rating 202/88, Downloaded by 4090    Comments, bugs, improvements  Vim wiki

created by
Aristotle Pagaltzis
 
script type
utility
 
description
This plugin lets you use filetype-dependent templates for new files, using a simple but effective mechanism.

It is, in various ways, a more sophisticated approach to the same problem that vimscript #1160 addresses, but doesn't try to do quite as much.

When you start a fresh buffer, setting a filetype on it will load the corresponding template. E.g. open Vim and issue

    :setf html

You should find a skeleton HTML file, ready to fill in.

One new command has been added for convenience: it is called :New and takes exactly one argument. It will open a new empty window and set the filetype for it to the argument given.

A handful of templates are included, but the real purpose of the plugin is to allow you to easily create your own.
 
install details
Cloning from GitHub using a plugin manager is recommended.
https://github.com/ap/vim-templates

Otherwise download and unzip in your .vim directory.
 

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
templates.zip 6f4bad6cf6 2015-12-29 7.0 Aristotle Pagaltzis Configurable behaviour for existing empty files
ip used for rating: 54.145.55.135

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.
   
SourceForge.net Logo