-
In VS Code, select the File (Windows/Linux) or Code (macOS), menu, then select Preferences > User snippets.
-
In the list that appears, select html. (The option may appear as "html.json" in the Existing Snippets section of the list if you've created snippets previously.)
-
After VS code opens html.json, add the code below within the existing curly braces. (The explanatory comments, not shown here, describe details such as how the
$0
line indicates where VS Code places the cursor after inserting a snippet): -
Save the
html.json
file(Ctrl+S)
. -
Now, whenever you start typing the snippet's prefix, such as
djbaselayout
, VS Code provides the snippet as an autocomplete option, as shown in the next section. You can also use the Insert Snippet command to choose a snippet from a menu.