{"id":19211754,"url":"https://github.com/edibotopic/snippets-for-snippets","last_synced_at":"2026-06-03T16:30:58.852Z","repository":{"id":114296778,"uuid":"436405948","full_name":"edibotopic/snippets-for-snippets","owner":"edibotopic","description":"A snippet extension for use when writing snippets and snippet plugins in Visual Studio Code (trust me: it's helpful!)","archived":false,"fork":false,"pushed_at":"2021-12-09T00:36:34.000Z","size":4300,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-04T17:15:42.453Z","etag":null,"topics":["extension","jsonc","snippets","visual-studio-code","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=edibotopic.snippets-for-snippets","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edibotopic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-08T22:07:58.000Z","updated_at":"2022-05-18T10:42:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"58438898-f35f-4f98-89f4-67aee5af4686","html_url":"https://github.com/edibotopic/snippets-for-snippets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edibotopic%2Fsnippets-for-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edibotopic%2Fsnippets-for-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edibotopic%2Fsnippets-for-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edibotopic%2Fsnippets-for-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edibotopic","download_url":"https://codeload.github.com/edibotopic/snippets-for-snippets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240286516,"owners_count":19777354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["extension","jsonc","snippets","visual-studio-code","vscode","vscode-extension"],"created_at":"2024-11-09T13:44:39.018Z","updated_at":"2025-11-14T16:05:14.444Z","avatar_url":"https://github.com/edibotopic.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snippets for Snippets\n\nThis is a plugin that provides helpful *snippets* for use when **creating local user snippets** or **developing snippet extensions** for [Visual Studio Code](https://code.visualstudio.com/).\n\nThe snippets can be inserted while editing a `.jsonc` file (superset of JSON *with comments*). For example, while typing \"create snippet\" in a valid JSON object (`{\u003cwithin these curly braces\u003e}`) pressing \u003ckbd\u003eenter\u003c/kbd\u003e while `create snippet` is highlighted in the *quick suggestion* menu will generate:\n\n```jsonc\n\n{\n    \"name of snippet\":{\n    \"prefix\": [\"prefix for snippet\"],\n    \"body\": [\n        \" body of snippet \"\n    ],\n    \"description\": \"description of snippet\",\n    \"scope\": \"language(s) of snippet\"\n   }\n}\n\n\n```\n\nYou can then press \u003ckbd\u003etab\u003c/kbd\u003e to traverse through the editable elements in sequence, which in this case would be the values for *prefix*, *body*, *description* and *scope*.\n\n![Demonstration of basic functionality](images/demo1.gif)\n\n## Features\n\nThe plugin includes snippets for creating the following:\n\n- Initialisation (`{ }`) of *JSON object* with cursor on new line\n- Insertion of *boilerplate snippet* (example above)\n- Insertion of *tabstops*, *placeholders*, *variables* and *choices*\n\nSnippet writing requires a specific syntax that can be difficult to recall if you are not writing them frequently (*maybe it's just me*). For example, to create a placeholder with three internal choices the following has to be written:\n\n```jsonc\n\n${1|choice1,choice2,choice3|}\n\n```\n\nThe `choice` snippet will generate the above line and allow you to define the traversal number and choices for the snippet you are writing as you \u003ckbd\u003etab\u003c/kbd\u003e through them.\n\nDetails on the use of these different built-in features for creating snippets in VSCode can be found in [this official guide for user-defined snippets](https://code.visualstudio.com/docs/editor/userdefinedsnippets).\n\n## Requirements\n\nThere are two potential use-cases for using snippets *while writing snippets*:\n\n1. Snippet extension development\n2. Local user snippet creation\n\n### Extension Development\n\nYou will need to have [NPM](https://nodejs.org/en/), [Yo Code](https://vscode-docs.readthedocs.io/en/stable/tools/yocode/) and [vsce](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#vsce) installed to develop extensions for VSCode.\n\nInitialise a directory for your snippet extension using `yo code` in your terminal. Choose \"New Code Snippets\" when prompted and enter the relevant information for your plugin. Open the project in VSCode when asked if you want to do so.\n\nThis will generate a `snippets.code-snippets.jsonc` in the `snippets` sub-directory. [Snippets for Snippets](https://github.com/edibotopic/snippets-for-snippets) should work in this file. When you are happy with your extension you can package and publish it with `vsce`.\n\nMore detail on publishing extensions [can be found here](https://code.visualstudio.com/api/working-with-extensions/publishing-extension).\n\n### Local Snippet Creation\n\nTo edit your local snippets type \u003ckbd\u003ecmd\u003c/kbd\u003e+\u003ckbd\u003eshift\u003c/kbd\u003e+\u003ckbd\u003ep\u003c/kbd\u003e to open the command pallette.\n\nNavigate to the relevant language in the dropdown menu that appears. You can then use the snippets as described previously.\n\n## Note: Snippets in Strings (\" \")\n\nBy default, VSCode doesn't allow snippets to be triggered *from within a string* but there are some simple workarounds and settings that need to consider:\n\n1. Check *spacing* within strings: When attempting to trigger a snippet within *here* `\"body\": [\"\u003chere\u003e\"]` it will not work unless there is a space inside each `\"` like this: `\"body\": [\" \u003chere\u003e \"]`. The boilerplate `create snippet` insertion contains such spaces in the `body` placeholder to facilitate the use of snippets by default.\n\u0026nbsp;\n\n2. Ensure you aren't triggering *mid-traversal*: If you \u003ckbd\u003etab\u003c/kbd\u003e to a default placeholder value it will not be possible to trigger snippets while the value is highlighted. You need to first delete the default value with \u003ckbd\u003ebackspace\u003c/kbd\u003e before you can trigger snippets automatically or manually.\n\u0026nbsp;\n\n3. Trigger *automatically*: Enable *quick suggestions* for strings: to achieve this the following will need to be added to your `settings.json` in VSCode:\n\n```json\n\n    \"editor.quickSuggestions\": {\n        \"other\": true,\n        \"comments\": false,\n        \"strings\": true\n    }\n\n```\n\n4. Trigger *manually*: You can also type \u003ckbd\u003ecmd\u003c/kbd\u003e+\u003ckbd\u003eenter\u003c/kbd\u003e to trigger the snippet menu, which might be preferable for some people.\n\n## List of Snippets\n\n- initialise a snippet file\n- create a snippet\n- placeholder\n- tabstop\n- choice\n- variable default\n- builtin variables for text and files\n- builtin variables for time and date\n- builtin variables for randomisation\n\n## Release Notes\n\n### 0.0.2\n\n- Minor corrections to README\n\n### 0.0.1\n\nInitial release with all major snippets included.\n\n## To-do\n\n- [ ] Consider key-binding(s)\n- [ ] Consider VSCode commands for Mac\n- [ ] Remove version info from README\n\n*Snippets for snippets' sake . . .*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedibotopic%2Fsnippets-for-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedibotopic%2Fsnippets-for-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedibotopic%2Fsnippets-for-snippets/lists"}