Every repository with this icon (
Every repository with this icon (
Text snippets reference
Espresso’s text snippets are virtually identical to Textmate’s:
$1through$ngives you tab stops #1 through #n$0gives you the final tab stop (usually positioned at the very end of the snippet)${1:something}gives you tab stop #1 with default text “something”${1:something} ... $1mirrors whatever gets entered in the first tab stop (in this example if you didn’t type anything you’d end up with “something … something”${1:something} ... ${1/\s.*//}mirrors and performs a transformation on the first tab stop. I’m a little shaky on the specifics of transformations myself; see the Textmate snippet documentation for the best resource on it I can find.
As far as I know, you can also do execute shell code in snippets by surrounding it in backticks: `command_to_execute`. I have not tested this myself yet.
If you wish to use a literal backtick or dollar sign in the snippet, you must escape it with a backslash: \$
TEA for Espresso specifics
At the time of this writing, MacRabbit has not published any easy way for users to create their own snippets or access common variables in snippets (there is no documented equivalent to $TM_SELECTED_TEXT, for example). By running powering your snippets with TEA actions, however, you will have access to a small number of action-specific placeholders. The most common by far is $SELECTED_TEXT. Any generic actions that allow you to wrap a selection with a snippet will replace $SELECTED_TEXT with whatever the user has selected when they ran the action.
wrap_selection_in_link also accepts $URL in the snippet definition, which will be replaced by the clipboard contents if they appear to be a URL, or with some fallback text if not.
See the Generic action API for which specific actions support $SELECTED_TEXT.






