Toolvito

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

Keep your snippets in the list. Search and filter them, then copy the code of a match.

Your values

Every word you type must be found. Leave it empty to list every snippet.

One tag, such as async. Leave it empty for every tag.

Snippets

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.

How to use the snippet manager

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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: json finds getJson.
  • 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": 1 and a list of snippets, each with title, language, tags (a list) and code. 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)"). Its prefix, the word you type in VS Code to insert it, is made from the title in small letters with hyphens. Its body is the code, one line for each item. A backslash and a dollar sign are written with a backslash in front, because VS Code reads $1 and ${1:name} as places to type. The tags become the description, and the language becomes the scope.
  • 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.
Languages and their VS Code scope
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.

Related tools