2

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.

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.