DEV Community

Cover image for How to share code snippets in 2022
Julien for Codiga

Posted on

How to share code snippets in 2022

It's 2022 and some developers are still saving code snippets locally while there are solutions to save them online and reuse them across multiple IDE.

Sharing a snippet in VS Code

Sharing a snippet in VS Code has never been more easy. With the Codiga VS Code extension, select the code you want to share, right click and select Create Recipe.

Image description

Make sure you fill the keywords section as this is how the snippet is found when developers look for a snippet in their IDE with Codiga.

Sharing a snippet in JetBrains products

As with VS Code, sharing a snippet is done with few clicks. With the Codiga JetBrains extension, just do the following:

  1. Select the code you want to share
  2. Right click and select Create Codiga Recipe
  3. Fill the information on Codiga

Make sure you fill the keywords section as this is how the snippet is found when developers look for a snippet in their IDE with Codiga.

Image description

Sharing a snippet in Chrome

You can also create snippets directly in Chrome! Make sure you install the Codiga Chrome extension and:

  1. Select the code you want to share
  2. Right click and select Create Codiga Recipe
  3. Fill the information on Codiga

Make sure you fill the keywords section as this is how the snippet is found when developers look for a snippet in their IDE with Codiga.

Image description

Using a snippet

VS Code

Using a snippet is even easier than creating it! In VS Code, type ⌘ + SHIFT + C to open the snippet finder, type the keywords and select the snippet you want to import!

Image description

JetBrains products

As with VS Code, using a snippet in JetBrains products is really straightforward. Open the snippet finder using ⌘ + ALT + C, enter the keywords you are looking for and select the code you want to import.

Image description

Finding snippets

You can find snippets, rate and comment on them on the Codiga marketplace. It contains hundreds of snippets for 15+ languages.

Links

Discussion (0)