Sublime Forum

Snippet weird behavior

#1

Hello community

I wrote a snippet which trigger is TOTO.

In a file, I write:

TO
gives me TOTO
TOTO
replace TOTO by TODO
TODO
gives me
touch(filename)

If instead I write:
hello TOTO
the trigger is cleared and only “hello” remains

I’m new to ST2 but I guess it’s not the intended behavior.

How do I get my snippet working?

TIA

greg

0 Likes

#2

I found the solution for one of the two problem: dollar signs must be escaped.

I still don’t understand the first part…

0 Likes

#3

No one understand this snippet behavior?

0 Likes

#4

Why not actually post your snippet code?

0 Likes

#5

Really simple:

<snippet> <content><![CDATA[ Hello, ${1:this} is a ${2:snippet}. ]]></content> <!-- Optional: Set a tabTrigger to define how to trigger the snippet --> <tabTrigger>TOTO</tabTrigger> <!-- Optional: Set a scope to limit where the snippet will trigger --> <scope>source.php</scope> </snippet>

0 Likes