Ruthvik
Ruthvik

Reputation: 840

How can I set the cursor selection for snippet in vscode?

I work in vscode and I recently got to know about snippets. I use a snippet generator website for doing that. But the problem I am facing is after inserting snippet in the code the cursor actually is set at the last of the snippet. But I want like it should keep the cursor in a certain position or select the variables which should be changed in the snippet. Is it possible? If yes, can I know how to do that?

Upvotes: 4

Views: 1724

Answers (1)

rioV8
rioV8

Reputation: 28673

Add the field $0 in the snippet

"body" : "<p>$0</p>"

Upvotes: 10

Related Questions