Skip to content

Snippets

Type a short prefix and a snippet shows up in completions. Files in VS Code’s snippet format work as is.

Location Applies to
The folder opened from Settings › Editor › User snippets Every project on this Mac
The project’s .vscode/*.code-snippets That project

<language>.json (for example, typescript.json) applies to that language; *.code-snippets uses its scope field.

{
"Log to console": {
"prefix": "log",
"body": ["console.log($1);"],
"description": "console.log"
}
}

$1, $2 are tab stops; ${1:name} adds placeholder text.