1

I'm trying to set up a snippet for building a set with appropriate spacing. I want the snippet to generate the following markup when I type "set" + TAB:

\{ \, content here \, \}

I have the following snippet:

<snippet>
<content><![CDATA[
\{\, ${1} \,\}
]]></content>
<tabTrigger>set</tabTrigger>
</snippet>

However, this produces the following:

{\,  \,}

It's escaping the first backslash and the last one. Any ideas on how to prevent this?

ohBoy
  • 13

1 Answers1

4

Note: I turned this into an answer following @egreg 's suggestion. This is not a very clear/correct answer (I let anyone to edit and correct it), but based (only) on my experience in TextMate.

You need to avoid escaping the backslash, which is “usually” done with \\{\, ${1} \,\\}.

Manuel
  • 27,118