Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>CodeSnippets.dev - Write it onceNew to Visual Studio Code? Get it now.
CodeSnippets.dev - Write it once

CodeSnippets.dev - Write it once

droopytersen

|
703 installs
| (4) | Free
Allows you to reuse code across projects
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

CodeSnippets.dev

https://codesnippets.dev

Code Snippets is a way to reuse code across many projects. Think of it like Github Gists on steroids.

With the Code Snippets VSCode extension, you can create and import snippets all without leaving the code editor.

Import Snippet

CodeSnippets Demo

No more messing with the difficult to use JSON strings to create custom VS Code Snippets. You can setup snippet placeholders to fill in values every time you use the snippet.

VS Code Snippets

Installation / Setup

  1. Install the VS Code Extension
  2. Go to https://codesnippets.dev/token and copy your access token
  3. Open the command palette (CRTL+SHIFT+P) and choose CodeSnippets: Login w/ Access Token Login Command
  4. Paste your access token (you copied in Step 2).

Using Snippets

When working in VSCode, you can quickly pull in your snippets from CodeSnippets.dev.

  1. Place your cursor where you want the code inserted
  2. Open the command palette (CRTL+SHIFT+P) and choose CodeSnippets: Insert/Import Snippet at cursor
  3. You will see a list of all your snippets whose language matches the languge of your current file on VS Code.
  4. Filter and select the desired snippet.

Import Snippet

Creating Snippets

You can highlight some code and save it as a new snippet.

You need to make sure you run the "CodeSnippets: Login w/ Access Token" command first.

  1. Highlight some code
  2. CTRL+SHIFT+P to open the Command Pallete
  3. Select the command,"CodeSnippets New/Create snippet from selection"
  4. Enter the Title, Collection (like a folder), and tags for your new snippet.

Create Snippet Demo

Placeholder Syntax

You can edit your snippets to use the built in VS Code snippet placeholder syntax. This way when you import your snippet you can fill in all of the placeholders.

In this example, there is a NAME placeholder.

import React from "react";

export default function ${1:NAME}() {
    return (
        <div>${1:NAME}</div>
    );
}

VS Code Snippets

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft