Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharing Visual Studio code snippets amongst a team of developers

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.

like image 392
David Boike Avatar asked Oct 23 '08 03:10

David Boike


People also ask

Can you work collaboratively on VS Code?

Live Share enables you to quickly collaborate with a friend, classmate, or professor on the same code without the need to sync code or to configure the same development tools, settings, or environment.

Is VS Code live share free?

We are committed to a substantive free tier of Visual Studio Live Share for developers to use on an ongoing basis.


1 Answers

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.

like image 109
Formentz Avatar answered Oct 20 '22 08:10

Formentz