{"id":13603201,"url":"https://github.com/mre/vscode-snippet","last_synced_at":"2026-02-04T13:44:01.680Z","repository":{"id":34834383,"uuid":"140688160","full_name":"mre/vscode-snippet","owner":"mre","description":"🐤 A Visual Studio Code extension for cheat.sh. Quickly and easily find code snippets for any language right inside your IDE.","archived":false,"fork":false,"pushed_at":"2024-05-01T04:28:04.000Z","size":5829,"stargazers_count":231,"open_issues_count":5,"forks_count":31,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-02T01:03:05.810Z","etag":null,"topics":["cheatsh","cheatsheet","snippet","vscode-extension"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/mre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"github":"mre"}},"created_at":"2018-07-12T08:59:11.000Z","updated_at":"2024-05-06T05:30:38.828Z","dependencies_parsed_at":"2024-01-14T15:26:16.753Z","dependency_job_id":"5abfdd27-1ba1-4366-9fa2-4184823be973","html_url":"https://github.com/mre/vscode-snippet","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mre%2Fvscode-snippet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mre%2Fvscode-snippet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mre%2Fvscode-snippet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mre%2Fvscode-snippet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mre","download_url":"https://codeload.github.com/mre/vscode-snippet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241305431,"owners_count":19941152,"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":["cheatsh","cheatsheet","snippet","vscode-extension"],"created_at":"2024-08-01T18:01:57.141Z","updated_at":"2026-02-04T13:44:01.588Z","avatar_url":"https://github.com/mre.png","language":"TypeScript","readme":"\u003cimg width=\"50\" src=\"https://raw.githubusercontent.com/mre/vscode-snippet/master/contrib/icon.png\"\u003e\n\n# vscode-snippet\n\n[![The MIT License](https://img.shields.io/badge/license-MIT-orange.svg?style=flat-square)](http://opensource.org/licenses/MIT)\n[![GitHub](https://img.shields.io/github/release/mre/vscode-snippet.svg?style=flat-square)](https://github.com/mre/vscode-snippet/releases)\n[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Snippet-blue.svg?colorA=24292e\u0026colorB=0366d6\u0026style=flat\u0026longCache=true\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAM6wAADOsB5dZE0gAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAERSURBVCiRhZG/SsMxFEZPfsVJ61jbxaF0cRQRcRJ9hlYn30IHN/+9iquDCOIsblIrOjqKgy5aKoJQj4O3EEtbPwhJbr6Te28CmdSKeqzeqr0YbfVIrTBKakvtOl5dtTkK+v4HfA9PEyBFCY9AGVgCBLaBp1jPAyfAJ/AAdIEG0dNAiyP7+K1qIfMdonZic6+WJoBJvQlvuwDqcXadUuqPA1NKAlexbRTAIMvMOCjTbMwl1LtI/6KWJ5Q6rT6Ht1MA58AX8Apcqqt5r2qhrgAXQC3CZ6i1+KMd9TRu3MvA3aH/fFPnBodb6oe6HM8+lYHrGdRXW8M9bMZtPXUji69lmf5Cmamq7quNLFZXD9Rq7v0Bpc1o/tp0fisAAAAASUVORK5CYII=)](https://marketplace.visualstudio.com/items?itemName=vscode-snippet.Snippet)\n\nA Visual Studio Code extension for [cht.sh](https://cht.sh/).\n[Watch this lightning talk to learn more](https://www.youtube.com/watch?v=edGVRJf6uvg).\n\n## Features\n\n- Zero configuration: works out of the box.\n- Automatically detects programming language from current editor window.\n\n## Config options\n\n- `openInNewEditor`: open snippets or in new editor window (default) in line with current document.\n- `verbose`: add comments around code snippets.\n- `baseUrl`: base url of the cheat server ([see cheat.sh documentation](https://github.com/chubin/cheat.sh/issues/98#issuecomment-412472258))\n- `http.proxy`: VS Code proxy setting. If set, requests made by vscode-snippet will be sent through provided proxy ([see Visual Studio Code network settings](https://code.visualstudio.com/docs/setup/network))\n- `defaultLanguage`: Programming language name in lower case to use as default language when there is no open editor window.\n- `title`: Template string of a snippet title. You can use the following variables:\n  - ${language} - the programming language\n  - ${query} - the snippet query (search text)\n  - ${index} - the index of the snippet (e.g. 2 for the third answer)\n- `insertWithDoubleClick`: insert snippet with double click.\n- `showCopySuccessNotification`: Whether to show a notification after the snippet is copied to the clipboard.\n- `saveBackups`: Whether to create backups of the snippets.\n\n## Installation\n\nInstall this extension from the [VSCode\nMarketplace](https://marketplace.visualstudio.com/items?itemName=vscode-snippet.Snippet)\n\n## Usage\n\n### Search for a snippet\n\n1. Hit \u003ckbd\u003e⌘ Command\u003c/kbd\u003e + \u003ckbd\u003e⇧ Shift\u003c/kbd\u003e + \u003ckbd\u003ep\u003c/kbd\u003e\n2. Run `Snippet: Find`.\n3. Type your query and hit enter.\n\n![Preview](https://raw.githubusercontent.com/mre/vscode-snippet/master/contrib/find.gif)\n\n### Moving between answers\n\nSometimes the first answer is not what you're looking for.\nIn that case, use `Snippet: Show next answer` and `Snippet: Show previous answer` to show alternative snippets.\n\n### Search for snippet based on selected text\n\n1. Select some text in an editor window.\n2. Right click and choose \"Find snippet from selected text\"\n\n![Preview](https://raw.githubusercontent.com/mre/vscode-snippet/master/contrib/findSelectedMenu.gif)\n\nAlternatively, you can also run the `Snippet: Find Selected Text` from the\ncommand menu:\n\n![Preview](https://raw.githubusercontent.com/mre/vscode-snippet/master/contrib/findSelected.gif)\n\nYou can configure a keyboard shortcut. By default this is \u003ckbd\u003e⌘ Command\u003c/kbd\u003e + \u003ckbd\u003e⇧ Shift\u003c/kbd\u003e + \u003ckbd\u003es\u003c/kbd\u003e:\n\n![Preview](https://raw.githubusercontent.com/mre/vscode-snippet/master/contrib/findSelectedShortcut.gif)\n\n### Saving a snippet\n\n1. Select some text in an editor window.\n2. Right click and choose \"Save snippet\"\n3. Select a folder for the snippet\n4. Enter a name of the snippet\n5. Press \u003ckbd\u003eEnter\u003c/kbd\u003e\n\n![Preview](https://raw.githubusercontent.com/mre/vscode-snippet/master/contrib/snippets-storage/save.gif)\n\n### Inserting a snippet\n\n1. Open the Explorer by clicking \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003eE\u003c/kdb\u003e\n2. Open the Snippets section\n3. Click on the snippet that you want to insert\n\n![Preview](https://raw.githubusercontent.com/mre/vscode-snippet/master/contrib/snippets-storage/insert.gif)\n\n### Creating a folder for the snippets\n\n1. Open the Snippets section\n2. Click on the \u003ckbd\u003e+\u003c/kbd\u003e icon (alternatively, you can right click on any snippet or a folder and select \"New Folder\")\n3. Enter a name of the folder\n4. Press \u003ckbd\u003eEnter\u003c/kbd\u003e\n\n![Preview](https://raw.githubusercontent.com/mre/vscode-snippet/master/contrib/snippets-storage/create-folder.gif)\n\n### Renaming a snippet or a folder\n\n1. Open the Snippets section\n2. Right click on the snippet or a folder that you want to rename\n3. Select \"Rename\"\n4. Enter a new name\n5. Press \u003ckbd\u003eEnter\u003c/kbd\u003e\n\n![Preview](https://raw.githubusercontent.com/mre/vscode-snippet/master/contrib/snippets-storage/rename.gif)\n\n### Deleting a snippet or a folder\n\n1. Open the Snippets section\n2. Right click on the snippet or a folder that you want to delete\n3. Select \"Delete\"\n4. Confirm your choice\n\n![Preview](https://raw.githubusercontent.com/mre/vscode-snippet/master/contrib/snippets-storage/delete.gif)\n\n### Copying a snippet to the clipboard\n\n1. Open the Snippets section\n2. Right click on the snippet that you want to copy\n3. Select \"Copy\"\n\n### Moving a snippet or a folder\n\nYou can move snippets or folders in the Snippets view by dragging and dropping them\n\n![Preview](https://raw.githubusercontent.com/mre/vscode-snippet/master/contrib/snippets-storage/move.gif)\n\n### IntelliSense\n\nSaved snippets are displayed in IntelliSense\n\n![Preview](https://raw.githubusercontent.com/mre/vscode-snippet/master/contrib/snippets-storage/intellisense.gif)\n\n### Searching for saved snippets\n\n![Preview](https://raw.githubusercontent.com/mre/vscode-snippet/master/contrib/snippets-storage/search.gif)\n\n## Restoring snippets from backups\n\n### Restoring with the built-in backup mechanism\n\nvscode-snippet creates backups of your snippets when you delete, rename, move or save snippets. These backups are stored **locally** on your computer.\n\nTo restore a backup:\n\n1. Open the Snippets section\n2. Click on the ![History icon](https://raw.githubusercontent.com/mre/vscode-snippet/master/contrib/snippets-storage/history.png) icon (alternatively, you can run the \"Restore backups\" command)\n3. Select one of the backups from the list\n\n![Demo of restoring backups](https://raw.githubusercontent.com/mre/vscode-snippet/master/contrib/snippets-storage/restore-backups.gif)\n\n### Restoring with the VSCode settings sync\n\nIf you have [VSCode settings sync](https://code.visualstudio.com/docs/editor/settings-sync) enabled, you can restore snippets by using VSCode's built-in backup mechanisms: [https://code.visualstudio.com/docs/editor/settings-sync#\\_restoring-data](https://code.visualstudio.com/docs/editor/settings-sync#_restoring-data)\n\n## Exporting snippets\n\nVSCode stores snippets in the `state.vscdb` file in a `JSON` format.\n\nTo export the snippets:\n\n1. Find the `state.vscdb` file\n   - On Ubuntu Linux: `~/.config/Code/User/globalStorage/state.vscdb`\n   - On Windows: `AppData\\Roaming\\Code\\User\\globalStorage\\state.vscdb`\n   - On macOS: `~/Library/Application Support/Code/User/globalStorage/state.vscdb`\n2. Inspect the content of this file using some tool that can open SQLite files, for example: [https://inloop.github.io/sqlite-viewer](https://inloop.github.io/sqlite-viewer)\n   1. On this website, upload the `state.vscdb` file and run the following command:\n   ```sql\n   SELECT * FROM 'ItemTable' WHERE key like 'vscode-snippet.snippet'\n   ```\n   ![SQLite Viewer](https://raw.githubusercontent.com/mre/vscode-snippet/master/contrib/snippets-storage/vscdb.png) 2. Then click \"Execute\". You should get a single row with the key `vscode-snippet.snippet` and a `JSON` value. This `JSON` contains all of your snippets.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md)\n","funding_links":["https://github.com/sponsors/mre"],"categories":["TypeScript","cheatsheet"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmre%2Fvscode-snippet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmre%2Fvscode-snippet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmre%2Fvscode-snippet/lists"}