You can insert a predefined piece of code called a code template by typing the template name and pressing
F2. To display the list of available templates, press
For example, if you type
F2the editor adds:
for = to // step 1
end // for
There are two types of templates: shared and exclusive. Shared templates are available across all edit modes. They are contained in the file
data\templates.txt. Exclusive templates are designed specifically for the current edit mode. A path to the exclusive template file can be customized with the
templatekey in the
The editor merges the content of shared and exclusive templates in a single list. Exclusive templates have priority over the shared with the same name.
Each template file has the following syntax: A template name is written in a separate line. The equal sign
=follows the name. After the equal sign you can also add a short hint. The template code starts at the next line, each line begins with the equals sign. The cursor position is marked with the
It's also possible to add a new template from the editor. Select the code and click the
Enter a name of the template, a description (optionally) in the dialog window, choose the type of the template, and press the
OKbutton. The template is ready to use.
Custom templates are saved in either
data\templates.custom.txt(custom shared templates) or in
data\<edit mode>\templates.custom.txt(custom exclusive templates). The latter can be customized in the modes configuration.