Search code examples
visual-studio-codegeneratorcode-snippetstext-cursor

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?


Solution

  • Add the field $0 in the snippet

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