- Code snippets are templates that make it easier to enter repeating code patterns, such as loops or conditional-statements.
Cogwheel -> User Snippets
Windows: Ctrl + Shift + P
Mac: Ctrl/Cmd + Shift + PYou can define snippets for each language like JavaScript, CSS, Go and more
The shortcut name you want to set to trigger the snippet.
Note: You can use multiple names hereSyntax: $1, $2
Make the editor cursor move inside a snippet.
Each tab key press will move the cursor to the next positionSyntax: ${1:default}
Same as tabstops but with a default valueSyntax: ${1:another ${2:placeholder}}
These can all be nested togetherSyntax: ${1|one,two,three|}
Placeholders can have choices in a dropdown list as values.Syntax: ${WORKSPACE_NAME:default}
You can insert some predefined variable namesIt is possible to transform values using regex
Example: Uppercase all charactersSet a description for the custom snippet