Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add common language snippets in Visual Studio Code?

In official vscode documentation i have seen that is possible to create custom snippets for each language. https://code.visualstudio.com/Docs/customization/userdefinedsnippets

Ex. (languageId).json

But if i want to define snippets common for all languages? It is possible?

like image 574
Gabriele Mantovani Avatar asked Dec 02 '16 15:12

Gabriele Mantovani


People also ask

How do I add a snippet in Visual Studio?

You can type ifwin to call this piece of code and press “tab” twice to generate the code. To include this new code snippet in Visual Studio you have 2 options: Add: where you can add a folder including various code snippets. Import: Add one or more code snippets to an existing folder.

How do I add languages to Visual Studio?

To do so: Choose the Language packs tab in the Visual Studio Installer. Select the language you prefer. Follow the prompts.


Video Answer


1 Answers

Common users snippets are currently not supported, but there is a VSCode issue tracking this feature request. Please let us know if this is something you would find useful.


For completeness, VSCode extensions can register the same snippets for multiple languages but they must explicitly specify all languages they provide snippets for (there is no "language": "*" option).

like image 167
Matt Bierner Avatar answered Oct 09 '22 21:10

Matt Bierner