{snippet}
Sample Usage
Settings
Setting Name Type Description Positional text The snippet property to get General Command Settings trim yes/no/left/right If yes whitespace is removed before and after the command. If left, only whitespace to the left is removed. If right, only whitespace to the right is removed.
| Setting Name | Type | Description |
|---|---|---|
| Positional | text | The snippet property to get |
| General Command Settings | ||
| trim | yes/no/left/right | If yes whitespace is removed before and after the command. If left, only whitespace to the left is removed. If right, only whitespace to the right is removed. |
The {snippet} command allows you to include information about the snippet itself within the snippet.
If you're looking to import another snippet into your current snippet, that would be the {import} command.
The {snippet} command takes a single positional setting that supports three different values.
| Property | Description | Example |
|---|---|---|
| id | The snippet's id. | xyz987 |
| shortcut | The snippet's shortcut. | /example |
| trigger | The snippet's shortcut as it was typed to trigger the insertion. | /Example |
Capitalization is important. Each property must be typed in lowercase into the command. For example, {snippet: id} will work, but {snippet: ID} will not.
Using the {snippet} command and the {import} command together
The {snippet} command will always refer to the snippet that was initially triggered by the user even if the command is nested within an imported snippet.
This means that if the {snippet} command is used within an {import} command, the {snippet} command will still refer to the initial snippet that was triggered, not the snippet being imported with the {import} command.
Case-sensitive insertion
{snippet: trigger} will return the shortcut exactly as it was typed including capitalization. This can be used to implement case-sensitive replacements.
For example, the following will insert the text "inserted text" while matching the capitalization of the shortcut. For example, if the shortcut was "/go" and you typed "/GO" it would insert "INSERTED TEXT". On the other hand, if you typed "/Go", it would insert "Inserted Text".
See the {if} command for more information on using conditional logic in your snippets.
upper() is a predefined function available to you in Text Blaze. See the Blaze Formula Language Reference for more information on the various predefined functions available to you.