Sharing Visual Studio code snippets amongst a team of developers
Asked Answered
K

2

15

Has anyone come up with a good way to share a set of Visual Studio Code Snippets (actual .snippet files that Visual studio uses) amongst a team of developers automatically? It would be great for other developers on my team to benefit from shortcuts I've created for myself, and vice versa.

Kerb answered 23/10, 2008 at 3:55 Comment(0)
H
4

I know this post is very old, but I found another good way (IMO) for sharing snippets, maybe in addition to the solution @Kevin Dente provided: using git!!

I shared successfully snippets and project templates creating an ad hoc git repository named snippets.git, I cloned it into the MyDocuments\Visual Studio 2015\Code Snippets folder and now I can add, edit or delete snippets from MyDocuments\Visual Studio 2015\Code Snippets\Visual C#\My Code Snippets (or Visual Basic folder), then commit and push to make them available to all other team members with the same configuration.

The principle is applicable also to the project templates, you can create a templates.git repository and clone it to the MyDocuments\Visual Studio 2015\Templates folder, then create the templates under the MyDocuments\Visual Studio 2015\Templates\ProjectTemplates\Visual C# folder (or Visual Basic folder).

This way the developers can periodically pull the two repositories and have up to date snippets and templates, available almost everywhere the git server is reachable (anyone said github? or bitbucket?).

Of course I am using Visual Studio 2015, but the method can be used with previous and, I think, future versions of Visual Studio.

Hightoned answered 24/3, 2016 at 11:13 Comment(0)
K
0

It's 2018 now and the VS Code team has added this feature (currently in preview)

See this ticket for more info

Kaolinite answered 30/11, 2018 at 21:31 Comment(1)
The feature in question is about Visual Studio, not Visual Studio Code.Bodega

© 2022 - 2024 — McMap. All rights reserved.