Adding Placeholders
The easiest way to add a placeholder is to use the Insert Placeholder button and fill in the required fields. It will automatically generate the placeholder and insert it into the template.
To learn more about placeholders, see Placeholders.
You can also access this window by pressing CMD + N
.
Creating Template
If you have a template that you want to convert to a snippet, you can select each fragment that you want to replace with a placeholder and use the Insert Placeholder button. It will automatically replace the selection with a generated placeholder. This way you can quickly convert your existing text to a snippet.
It is also possible to ask AI Assistant to automatically insert placeholders.
Field Title
A common parameter is the Field Title. It is both an identifier and a label for the placeholder. It appears in the Live Template and helps you understand what is expected here.
Help
If you are not sure what a specific parameter means, you can click on the ? button to see a detailed description.
Placeholder Syntax
Each placeholder has a unique syntax, but they all start with {@
and end with
@}
. Inside the curly braces, you can find the placeholder type and its
parameters separated by |
.
{@calculated-date|-1m2d|dd.MM.yyyy|English@}
Here you can see a Calculated Date placeholder that subtracts one month and adds
two days to the current date. The date is formatted as dd.MM.yyyy
and the text
is in English.
Manually Typing Placeholders
Usually, it is safe to copy-paste placeholders. You can also type them manually, but be careful with the syntax.
Most placeholders will automatically reuse the same value if they are used multiple times in template and have the same parameters. For example, if you copy-paste two Selectable Date placeholders, they will automatically use the same date.
The same applies to Text Variable, you can reuse the same value in multiple places by just copy-pasting the same placeholder. If you need an additional transformation, you can use the Text Variable Reference placeholder.
Deleting Placeholders
Placeholders are just text, so you can safely delete them as you would any other text.
If you are using the Text Variable Reference placeholders, make sure to delete all references to the deleted variable as well.
Applying Styles
If you use Rich Text, you can apply styles to the placeholder. Just select the placeholder and use the formatting options in the toolbar.
The inserted value will have the same style as the placeholder.