Works on this device
Code Snippet Manager
Keep your code snippets in one list, each with a title, a language and tags. Search them by words, filter by language or tag, and copy the code you need. Save the list as a file or keep it in this browser. Nothing is sent anywhere.
Enter your values
Check these values
This is off unless you turn it on. Saved entries stay in this browser only. Untick the box to delete them.
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose the button below them.
Your result
How it was worked out
How to use the snippet manager
- Under Snippets, give each snippet a Title, choose its Language, add Tags separated by commas, and paste the Code. Choose Add a snippet for more. Three examples are there to start; change or remove them.
- In Find and copy snippets, type words in Search, or choose a language or a tag, then choose Search. The snippets found are listed, and the code of the first six has a Copy button.
- To keep your list in this browser, tick Save my entries on this device. It stays until you untick the box or clear the browser data.
- To keep a copy or move the list to another device, choose Save the snippets as a file and download the file. Later choose Open a snippet file, open it, and choose Use these snippets.
- For VS Code, choose the file format VS Code snippets file, download it, and put it into the snippets folder of VS Code. A VS Code snippets file can also be opened here.
How search and the files work
- Search: a snippet is found when every word you type is in its title, tags or code (or only in the part you choose under Search in). Capital and small letters are the same. Words can be parts of longer words:
jsonfindsgetJson. - Tag to show: a snippet is found when one of its tags is that tag, in any mix of capital and small letters.
- Snippet file: a JSON file with
"format": "toolvito-snippets","version": 1and a list of snippets, each withtitle,language,tags(a list) andcode. The order of your list is kept. - VS Code snippets file (
.code-snippets): one entry for each snippet, named by its title (a second snippet with the same title gets "(2)"). Itsprefix, the word you type in VS Code to insert it, is made from the title in small letters with hyphens. Itsbodyis the code, one line for each item. A backslash and a dollar sign are written with a backslash in front, because VS Code reads$1and${1:name}as places to type. The tags become thedescription, and the language becomes thescope. - When a VS Code file is opened here,
\$,\}and\\in the body become$,}and\again. A scope that is not on the list of languages becomes Plain text.
| Language | VS Code scope |
|---|---|
| JavaScript | javascript |
| TypeScript | typescript |
| JSON | json |
| HTML | html |
| XML (also SVG) | xml |
| CSS | css |
| SCSS | scss |
| SQL | sql |
| Python | python |
| PHP | php |
| Java | java |
| C | c |
| C++ | cpp |
| C# | csharp |
| Go | go |
| Kotlin | kotlin |
| Bash (shell) | shellscript |
| YAML | yaml |
| Markdown | markdown |
| GraphQL | graphql |
| Plain text (no highlighting) | (none) |
Worked example
With the three example snippets, a search for csv finds one snippet: Read a CSV file (Python, tags files, csv, 5 lines). The tag async finds Fetch JSON with a timeout. The language SQL finds Rows added this week.
Saved as a VS Code snippets file, Fetch JSON with a timeout gets the prefix fetch-json-with-a-timeout, the scope javascript, and its line if (!res.ok) throw new Error(`HTTP ${res.status}`); is written with \${res.status} in the body.
Limits you should know
- Up to 200 snippets, each with up to 20,000 characters of code.
- There are no accounts and no syncing. A list kept in this browser is not on your other devices; move it with a file.
- The code boxes of the list use a fixed-width font without colours. The code of each snippet found, and a saved file, are shown in the colours of their language; Copy and Download give the plain text. Plain text snippets have no colours. To see other code in colour, use the Syntax Highlighter.
- This page does not make the snippet files of Visual Studio (not VS Code), JetBrains editors or other programs, and it does not run your code.