0 comment(s).

Variables

Amy Editor defines several variables that are filled with values that can be used when snippet insertion is activated. They include such information as current caret line, column, contents of selection, word occurency relative to caret and other. You can use this information in your snippet code by following syntax: $CHAP_VARNAME. Let's see the most common variables (for full listing see the Developer section):

$CHAP_CLIPBOARD_TEXT - contains text in clipboard.

$CHAP_SELECTED_TEXT - contains selected text.

$CHAP_NEXT_WORD - contains word right after caret.

$CHAP_PREV_WORD - contains word before caret.

$CHAP_WORD[+-][n] - contains n-th word before (-) or after (+) caret. For example when using $CHAP_WORD-3, we will obtain third word before caret, using $CHAP_WORD+2 results in second word after caret being returned.

You can use variant with two dollar string in which case the value will be properly enclosed. This is useful mainly for code interpolating in the following section.