Templates |
Menu: Tools > Templates
Default Shortcut Key: Ctrl+T
Macro function: Templates()
The Templates command is used to select a Template for insertion at the text cursor. Boxer's Templates are an excellent way to save and recall small pieces of text such as address blocks, copyright notices, programming language constructs, email addresses and any other text block which is used frequently during editing.
When the Insert Template command is issued, the Templates menu appears in a popup window:
The active Template Set is displayed at the bottom of the window, and the Templates within that set are displayed in the main listing area. Press the first letter of the Template name or cursor with the arrow keys to select the desired Template. Press Enter (or double click with the mouse) to insert the selected Template into the file.
Right-clicking on a selected item summons the Template context menu. The context menu provides options to insert the selected item, or to copy it to the current clipboard.
Template Sets and Templates are defined using the Configure | Templates command.
Text Cursor Placement The Vertical Rule character (|) can be placed within a Template to dictate where the text cursor should be placed within the Template following its insertion. This allows, for example, programming code blocks to be defined in which the text cursor is placed between a pair of parentheses, ready for additional code to be typed.
Operating on Selected Text The caret or circumflex character (^) can be placed within a Template to indicate that the template should operate on a text selection. A pair of examples will help to illustrate the power of this feature:
Example 1: The template <B>^</B>| would cause the current text selection to be surrounded with HTML bold tags. The text cursor would be placed at the right of the closing bold tag.
Example 2: The following Template:
<html> <head> | </head> <body> ^ </body> </html>
could be run after using the Select All Text command to select the entire file. The effect would be to add the required HTML tags that help make an ordinary text file ready for viewing on the Internet. The text cursor would be place between the <head> and </head> tags, awaiting a title for the document.
Unindenting within a Template If you need to unindent within a defined Template, use the tilde character (~) to designate the point at which the Backspace command should occur. The tilde will not be recognized in this way unless the Insert as if typed from the keyboard option is in force (see Configure | Templates).
|