0

It is possible to use Snippets that I have stored in Gist in Visual Studio Code.

Preferably it was an extension that allows me to keep them in gist and be able to modify them there without the need to download and install them in VSCode.

1 Answer 1

1

I have the same problem as you.

So, I made a tool NPM cli Generate code-snippets from gist

You can generate code-snippets from gist easily by gisnippet sync <id>

Its name is gisnippet, which means gist+snippet

  1. Install nodejs

  2. Easily install it with npm install -g gisnippet

  3. Authorize your github token, which has gist permissions with gisnippet login <yourtoken>

  4. (Optional) Set the code-snippet path of your vscode with gisnippet globalfolder <path>. Usually this path looks like this C:\Users\yourname\AppData\Roaming\Code\User\snippets

  5. View all gist with gisnippet show, You can see the description, id, and included files of your gist

     vuetify-template e2189f3b10cd5c83156e4c7ac6b9ad4f 2020-10-19T02:55:07Z
    
    • wireframe-base.vue 452
    • wireframe-constrained.vue 2101
    • wireframe-discord.vue.vue 2393
    • wireframe-extended-toolbar.vue 9
    • wireframe-inbox.vue 2547
    • wireframe-side-navigation.vue 526
    • wireframe-system-bar.vue 1171
    • wireframe-three-column.vue 1609
  6. Copy the gist id, and use gisnippet sync <gist id> to convert the gist into a code-snippets file. The optional parameter -g means that the code-snippet file will be generated in the set global folder, otherwise it will be generated in the current folder. You can copy the generated result to the .vscode folder in the root directory of vscode so that it can be used only in the current project

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.