1

I have a bunch of useful snippets that I want to share with my team. Ideally I'd put these on our network storage and have everyone's Visual Studio Code installation point to that file/folder, but as far as I understand VSCode can only load snippet files directly from the %appdata%\Code\User\snippets folder.

Is there a setting that would allow me to load snippets from other folders?

Unfortunately we work on multiple projects, so using workspace-scoped snippets in the .vscode folders only helps us a little bit. Whenever we have a new project we have to copy the entire folder over and this leads to inconsistencies whenever a snippet gets updated.

1 Answer 1

1

You could try adding a symbolic link to your shared folder inside %appdata%\Code\User\snippets.

The article Adding Snippets to Visual Studio Code contains more information about sharing your snippets as a snippet extension, using the yo code extension generator. This method might not fit here, because it's basically copying the snippets, but the symbolic link approach might help.

See the article The Complete Guide to Creating Symbolic Links (aka Symlinks) on Windows.

2
  • Ideally I'd just use a folder config somewhere hidden in code, but since that doesn't exist, a symbolic link will suffice I guess. At least it's something I can solve with a simple batch script.
    – MMM
    Commented Jul 29, 2021 at 8:33
  • The idea of sharing through an extension is also pretty good - I could easily keep stuff up to date using our private NPM repo that way.
    – MMM
    Commented Jul 29, 2021 at 8:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .