Domanda

I want to put literal $ in sublime-completions file. I tried first

{ "trigger": "request", "contents": "\$$1 = request('$1');" }

but this seems malformed. It corrupts the whole file. So I tried

{ "trigger": "request", "contents": "$$1 = request('$1');" }

this doesn't corrupt other snippets, but doesn't work neither. When I type in req[tab], 'req' disappears.

How can I put literal $ in completions file? (I know it works in seperate sublime-snippet file, but I want to organize things.)

È stato utile?

Soluzione

That may seem strange but here's how it should be:

{ "trigger": "request", "contents": "\\$$1 = request('$1');" }

So $ is \\$.

Just in case, \\$0 will output $0

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top