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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs