Sublime Forum

How to add the $ character inside my snippet

#1

Hi I’m trying to add $ sign inside my snippet so it will be displayed as string like so:

$this->string(${2:length}),]]>

but when I use it by typing the tab trigger, I only get the output without the $ sign showing up:

‘name’ => ->string(length),

The string $this is missing. How can i fix this?

Thanks

0 Likes

#2

escape it with a backslash: \$

http://docs.sublimetext.info/en/latest/extensibility/snippets.html#snippets-file-format

2 Likes

#3

Awesome. Thanks.

0 Likes

#4

If my PR ever gets accepted, it will become super easy to spot such problems :slight_smile:

2 Likes