Its a pretty fast hack, but it works for me, so i thought i would share it with the rest of you.
Basically you need to create a template for each extension.
for example:
template.cc.tpl is used when creating a buffer with the extension .cc
and put these templates in the directory set in the in the template_dir
variable.
Have a look in template.sl, it's pretty simple.
to use it, just put a
require("template.sl") into your .jedrc
and call the function insert_template from the appropiate
mode hook.
It also preforms some basic variable substituions when loading the
template into the buffer.
At the momment it recognices the following keywords @filename@ -> the basename of the buffer. @filename_sans@ -> the basename of the buffer sans the extensions. @author@ -> substitutes for the variable author set in template.sl @point@ -> if set, puts the cursor on this line when done. Take it easy, Mikael
Attachment:
template.sl.gz
Description: GNU Zip compressed data