Code snippets are managed through the Code Snippets dialog box.
This dialog box can be shown using the Project|Code Snippets menu command.
Snippets may use two special identifiers in their definitions:
Access level | Meaning |
---|---|
$selected$ | Selected text before expanding the snippet. Only available for surround expansions. |
$end$ | Final position for the insertion point. Always available. |
Most of the times, there's no need to include the $selected$ identifier in a snippet declaration, or this identifier must be adjacent to the $end$ identifier. However, there are also cases when we need both special parameters. Suppose you write a snippet for the repeat statement:
repeat $selected$ until $end$;
You can select a group of statements and perform a surround expansion of the new snippet. The selected statements will be wrapped inside the statement, as the result, and the insertion point moves after the until keyword, to allow you to type the loop condition.
The Integrated Development Environment
Project management
The Code Editor
Keyboard shortcuts
Environment options
The Freya Programming Language