DEV Community

Manthan Ankolekar
Manthan Ankolekar

Posted on

User Snippets in VS Code

To create user snippets in Visual Studio Code for example JavaScript, you need to follow these steps:

  1. Open Visual Studio Code.
  2. Go to the File menu and select "Preferences," then choose "User Snippets."
  3. Select "New Global Snippets file" if you want the snippets to be available for all projects or "New Snippets file for " if you want the snippets to be project-specific.
  4. Give your snippet file a name, such as "javascript.json" and press Enter.
  5. Visual Studio Code will open the newly created snippet file.
  6. Inside the file, add your JavaScript snippets using the JSON format. Each snippet consists of a unique key and a value containing the snippet content.

Image

Top comments (0)