How to Add Custom Code Snippets in VS Code | Add your own VS Code Snippets

Bharti Kumari
3 min readJul 22, 2022
custom code snippets in VS Code

Do you know how to add your own code snippets to Visual Code Studio? If your answer is no, this blog will assist you in doing so. So, read this blog post to boost your coding productivity.

This example illustrates how to add custom code snippets in Visual Studio Code.

Step 1: Open your VS Code editor and click on the settings icon.

Step 2 : Now you have to click on configure user snippets.

Step 3 : Choose the language in which you want to insert the code snippet.

Step 4: Now, go to https://snippet-generator.app/ and add your custom code into the right-hand side box, as shown in the image below, as well as add a shortcut trigger word from which you want to trigger it, and copy the snippet. As illustrated in the image.

Step : 5 Now, In VS Code, perform the following steps as shown in the image:

settings > configure user snippets > select the language > paste the snippet code and save (ctrl+s)

That’s it; you’re now ready to use your code snippets in VS code by simply typing the trigger word.

Thank you for taking the time to read this blog. Lastly, if you enjoy this blog, please leave a comment below.

--

--

Bharti Kumari

Amazon ML Summer'23 | Technical Writer @ Scaler | Samsung SFT - Top 50 | Mentor @GSSoC'23 | MongoDB Community Creator