Create new snippet

To generate a new template from a DVT predefined one, use the DVT: Create New Snippet… command and follow the steps:

  1. Select the DVT predefined snippet

  2. Select an existing snippets file or create a new one

  3. Specify the snippet file name in case you selected to create a new one

Step 1. Select DVT snippet

Select the DVT predefined snippet. The quick pick contains the snippets corresponding to the selected natures.

../../_images/vscode-select-dvt-snippet.png

Tip

When you have multiple project natures, you can quickly navigate between the associated snippets using Alt+Arrow Up / Alt+Arrow Down.

Step 2. Select file

Select the place where you want to insert the selected DVT snippet. You can either insert it in an existing file or create a new one.

../../_images/vscode-select-snippets-file.png

Step 3. Specify file name

In case you selected to create a new file in the previous step, you will be prompted to insert a file name for your new file.

Note

The specified file name will be suffixed with the .code-snippets extension.

Tip

To open an already existing snippets file you can use the Snippets: Configure Snippets command.

Tip

You can assign a custom keyboard shortcut to any snippet for even faster access. For more information, see the Assign keyboard shortcuts to snippets chapter from the VS Code documenation.