When a snippet is inserted, you can easily see all editable fields in the command line.
For example, in Snippet Template, the first editable field
(foo
) is highlighted.
Typing something changes the foo
value to whatever you type
(value1
). Notice that both foo
values change to value1
in one operation.
Pressing the Tab key moves the cursor to the next editable field,
causing bar
to be highlighted.
Typing something changes the bar
value to whatever you type
(value2
). Notice that both bar
values change to value2
in one operation.
Pressing the Tab key again finalizes the code.
To define an editable field, you must use the following notation:
${
,
where #
:default_value
}
is the index of the field.
For the first editable field, the value is 1. To
reference an editable field that is already defined, you simply need to specify its
index (#
${
) as shown in the
following figure for the snippet Geometry.#
}