vim file templates (aka skeletons) using Mako template engine
Install to ~/.vim/plugins/ or if using pathogen
git clone https://github.com/jabbas/vimplates bundle/vimplates
Default templates directory is .vim/templates or (if you use pathogen) .vim/bundle/vimplates/templates you can change it by adding this line to your .vimrc:
let g:vimplates_templates_dirs = ['/path/to/templates', '/another/path/to/templates']
You can configure some special variables which will be used in templates:
g:vimplates_username(default:"John Doe"),g:vimplates_email(default:"[email protected]"),g:vimplates_website(default:"http://nothing.com"),g:vimplates_license(default:"GPL-3")
By default vimplates uses filetype set by vim as a name of the template, so for python it uses python, for perl perl etc...
There are some special variables you can use in the templates:
usernamewill put contents ofg:vimplates_username,emailwill put contents ofg:vimplates_email,websitewill put contents ofg:vimplates_website,varsis an container for:vars.filename- filename of the file you opened in current vim buffer,vars.filetype- file type set by vim,vars.cwd- current working directory,- ... and will be more in the future
vima reference to vim module (see:help python-vimor vimdoc.sf.net)
Basically, Mako uses python inside templates. See Mako Documentation and/or templates directory for examples.
- improve cursor position (it's ugly and does not work in some cases)
- loadable per file,
- moar templates/examples