I am interested in if there is a mean to indicate where the writing the variable name should start
e.g if I call this live template:
console.log(\'$T
You cannot do that for the same variable as each variable is processed only once.
Solution: create another/intermediate variable that will automatically receive the same value and arrange them in desired order.
Create new variable and give it different name (e.g. $VAR$
):
console.log('$TEXT$', $VAR$);$END$
(I've also added $END$
to denote final cursor position)
Click on Edit Variables
button.
Rearrange variables in desired order (using Up
/ Down
buttons on the right side).
Assign default value for TEXT
variable: make it to accept the value that you will enter for VAR
variable.
Also check Skip if defined
checkbox if you do not plan to edit the TEXT
value while filling the variables.
Result: only 1 place to enter variable name (code completion if available if needed) and entered value is automatically copied into the text field (which you can still edit later once you done with expanding the template).
Related StackOverflow question: https://stackoverflow.com/a/40606436/783119