
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:
1
Open
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:
1
Open
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">
.
Содержание ColdFusion Server 5
Страница 18: ...xviii About This Book...
Страница 26: ...8 Chapter 1 Setting Up the Product...
Страница 42: ...24 Chapter 2 Configuring Browsers and Servers...
Страница 60: ...42 Chapter 3 Exploring the Workspace...
Страница 100: ...82 Chapter 6 Editing Pages...
Страница 126: ...108 Chapter 7 Using Web Development Languages...
Страница 212: ...194 Chapter 13 Customizing the Development Environment...
Страница 320: ...302 Glossary...