Modifying syntax expansion templates, Adding syntax expansion for other languages – Slick EDIT V3.3 User Manual

Page 182

Advertising
background image

To change the minimum expandable keyword length, enter the value by using the Minimum expandable
keyword length
spin box.

To set options such as brace style, click the Options button on the Extension Options dialog.

Tip

SlickEdit

®

Core can display Syntax Expansion choices for the word prefix under the cursor. To

turn this option on/off, select the

Auto-Complete Tab

on the Extension Options dialog, and select/

deselect the Syntax expansion option. See

Completions

for more information.

Modifying Syntax Expansion Templates

Syntax Expansion templates are essentially extension-specific aliases that have been pre-defined. You
can modify these templates by replacing them with your own.

For example, to add a comment to the end of C for, while, if, and switch statements:

1. From the main menu, click Window

Preferences, expand SlickEdit and click General in the tree,

then double-click the File Extension Setup. The Extension Options dialog is displayed.

2. From the Extension drop-down list, select the c extension.

3. Select the

General Tab

.

4. Click Aliases to display the Alias Editor dialog.

5. Click New and then type for as the alias name.

6. Type the following lines in the text box to the right of the alias name:

for (%\c;;) {

} /* for */

The %\c escape sequence above specifies the cursor placement after expansion is performed.

7. Repeat Steps 5 and 6 for the while, if, and switch keywords.

8. Click OK to save new aliases.

The above steps replace the default Syntax Expansion templates for these keywords. The C brace style
options will not affect defined aliases.

For more information on working with aliases, using the Alias Editor, or using alias escape sequences,
see

Extension-Specific Aliases

.

Adding Syntax Expansion for Other Languages

Modifying Syntax Expansion

Templates

160

Advertising