Gruntfuggly / auto-snippet

A vscode extension to automatically insert a predefined snippet when a file is created, or an empty file is opened.
Other
14 stars 1 forks source link

Add .snippets directory #15

Closed rollie42 closed 2 years ago

rollie42 commented 2 years ago

So this is a suggestion (I'm actually willing to write the logic and make a PR): Create a command action "Generate .snippets directory", which will create a top level directory, under which a number of files will be created, based on the known extensions already in use in the project. So if I have a typical react app, it could create

.snippets/
  snippet.css
  snippet.js
  snippet.html
  snippet.ts

And set the configuration to use the contents of these files as the 'snippet' for the project.

The reason I'd advocate for this is it means users don't have to remember or use the snippet edit interface, and it's very obvious looking at the project what the defaults are. Also, it would remove the need to add to the 'snippet namespace', such that your default file snippets won't show up when coding within a file. Also this allows for easy sharing with other collaborators.