User Guide

Using Inline Tools to Enter Code 59
Auto Completion
Auto Completion completes a code block by inserting the appropriate code when
you type the opening code fragment (trigger string).
You can set options for this feature in the Options > Settings > Editor > Auto
Completion pane.
Only a few strings are listed by default; for example, to insert --> after you type <!-- for
a code comment. You can also specify the cursor position after insertion; for
example, before --> in the previous example of the code comment. You can insert
any user-defined string, even blocks of text or code; however, you might want to use
code templates for whole blocks of text and code snippets for whole blocks of code.
Code Templates
A code template provides a shortcut for entering static text blocks. As with Auto
Completion, this feature is intended for user-defined strings.
To define a code template:
1Open Options > Settings > Editor > Code Templates.
2 In the Code Templates pane, click Add.
3 In the Add Code Template dialog box, type a keyword, a description of the code
template, and a value to be inserted in place of the keyword. Click OK.
For example, you could enter dt4 for the keyword, HTML 4.0 Doctype for the
description, and for the value,
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
.
If the value includes a tab, it is inserted as an ASCII #9 character, unless the
Options > Settings > Editor > Insert tabs as spaces option is selected.
4 The code template displays in the list. Click Apply to save your changes.
To edit a code template:
1Open Options > Settings > Editor > Code Templates.
2 In the Code Templates pane, click Edit.
3 In the Edit Code Template dialog box, change values as needed and click OK.
4 Click Apply to save your changes.
To insert code template text:
1 Type the keyword.
2 Press Ctrl+J to expand the text.
For example, the keyword dt4 expands to
<!DOCTYPE HTML PUBLIC "-//W3C//DTD
HTML 4.0 Transitional//EN">
.