Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling the last tab cursor movement in a Sublime Text snippet

I'm looking for a way to disable the last tab cursor movement in a Sublime Text snippet.

For clarity I'm referring to the last press of the tab key that brings you to the end of the snippet. In the below example, with '|n' representing each cursor position, I do not want to be moved to cursor position 2.

{% block |0 %}
    |1
{% endblock |0 %}|2

The slight inconvenience this causes is having to exit/cancel the snippet auto completion before I can use Emmet completions at cursor position 1.

Any feedback is appreciated. Thank you.

like image 560
Soytoise Avatar asked Jan 10 '23 23:01

Soytoise


1 Answers

Just found this answer on the sublime forums. If no $0 or ${0} is specified, it seems to default to the end of the snippet. If you change your snippet to:

{% block $1 %}
$0
{% endblock $1 %}

Then you will not get the last tab in the above |2 position. Oddly enough, the $1 will still come first.

like image 188
TJSimons Avatar answered Jan 13 '23 13:01

TJSimons