miyagisan
miyagisan

Reputation: 995

Visual Studio Code extension for saving and reusing my own custom code snippets / boilerplate?

I am looking for VSC extensions that will let me save my own code snippets and reuse them in any future projects with shortcuts like when I type html I am able to pick an option that generates whole document example that I can then continue modifying.

Ideally it should also have an option to export all custom settings so I can move them to another machine or back them up if I need to format the system.

I realized this was one of my major efficiency issues when I kept copying code from old projects to be reused in my latest work. I did check the extension search in VSC but so far only found such that already include existing snippet shortcuts.

Upvotes: 2

Views: 1571

Answers (1)

miyagisan
miyagisan

Reputation: 995

I found 1 viable method so far with native VSC but post if you know of an even better way.

Press Ctrl + P and > then type Preferences: Configure user snippets and then selecting a language. To generate json fast I used: https://snippet-generator.app/

It saves snippets in AppData\Roaming\Code\User\snippets folder so that is good for backuping or exporting.

To reorder snippets to have custom ones at the top of the suggestions box for faster use go to: Workspace Settings > Text Editor > Suggestions > Snippet Suggestions and set it to top.

Upvotes: 3

Related Questions