Table of Contents
The Templates plugin can be used to insert code (or text, markup, etc.) templates into the current buffer. As of version 3.0.0, the Templates plugin uses Apache Velocity as its underlying templating engine. The inclusion of the Apache engine provides many advantages over the previous approach, including:
Templates can prompt for values for variables
Beanshell snippets can be embedded in templates
Templates may "include" nested templates
jEdit-specific directives allow changes to the current buffer (eg. set caret position, change buffer mode, etc.)
Easily extensible
In order to function properly, the Templates plugin requires two directories in which to store files. These two directories are:
Velocity resources directory
templates directory
The Velocity directory is used to store files which control the operation
of the Velocity engine, as well as the template accelerators file (refer to
Template Accelerators). Most users will have
no need to modify files in this directory. Advanced users, though, should
note that if they wish to use a velocity.properties
file (refer to the Velocity User's Guide for further information)
to affect the operation of the templating engine, this directory is
where it would go. The default Velocity directory is
$USER_SETTINGS/velocity
,
where $USER_SETTINGS is the user's jEdit settings directory (refer to jEdit
help documentation for more information about the settings directory).
The templates directory defines where the plugin should look
for user templates. All
files found in this directory or any of its subdirectories, with the
exception of jEdit backup files, are assumed to be template files. For this
reason, the Velocity directory may not be a subdirectory of the templates
directory,although the templates directory may be a subdirectory of the
Velocity directory. The default templates directory is
$USER_SETTINGS/templates
.
The location of these directories may be modified under
> > > > .