The Freya Integrated Development Environment

Code Snippets Manager

See also

Code snippets are managed through the Code Snippets dialog box.

The Code Snippets dialog box

This dialog box can be shown using the Project|Code Snippets menu command.

Special snippet identifiers

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.

See also

The Integrated Development Environment
Project management
The Code Editor
Keyboard shortcuts
Environment options
The Freya Programming Language