DEV Community

El Bruno
El Bruno

Posted on • Originally published at elbruno.com on

#VSCode – Create and use Code Snippets πŸ—’οΈ in @code

Hi!

Code Snippets are super useful and creating your custom Code Snippets is super easy in Visual Studio Code. The official Documentation (see references) explains how to create snippets, with the full details of the JSON file, sections, contents and more. However, there are some extra tips on top of this information that are super useful.

Snippet Creator

I moved from using Visual Studio Code Extensions to using this website.

https://snippet-generator.app/

Just paste your piece of code and copy the generated JSON!

sample of the website generating code snippets

Workspace or Folder specific snippets

Now it’s time to use our snippets, so let’s save them in a json file. To do this, just create a file [mysnippets.code-snippets] and paste your own snippets here. These snippets will only be available for this workspace!

snippets for a workspace

Happy coding!

Greetings

El Bruno

More posts in my blog ElBruno.com.

More info in https://beacons.ai/elbruno


References

Top comments (0)