DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 964,423 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Randy
Randy

Posted on

I made a VS Code code snippet manager

Hi all. I often use VS Code code snippet to speed up my coding. It's a very useful feature in VS Code that I can create some snippet and use some special syntax to transform the snippet (like capitalize and generate uuid).

For example, I can use this snippet to quickly generate a setState code:

const [$1, set${1/(.*)/${1:/capitalize}/}] = useState($2)
Enter fullscreen mode Exit fullscreen mode

Image description

But it's very hard to maintain the snippet because snippet file in VS Code is a JSON file. Every line of snippet was separate into an Array like:

{
  "For Loop": {
    "prefix": ["for", "for-const"],
    "body": ["for (const ${2:element} of ${1:array}) {", "\t$0", "}"],
    "description": "A for loop."
  }
}
Enter fullscreen mode Exit fullscreen mode

To make it easier to maintain the snippets in VS Code, I made a code snippet manager tool to write snippet in nature way, then one click sync to VS Code.

Image description

You can download it now on: https://codespeedy.randyloop.com

It supports Windows and macOS. And the app size is only 7MB (No electron).

It's not open source yet because I'm not sure how many users it will have.

Top comments (0)

🌚 Browsing with dark mode makes you a better developer.

It's a scientific fact.