Docs menuSnippets and fragments

// docs · using snipstack

Snippets and fragments

What a snippet holds, how copying works, smart views, sorting and the Trash.

What a snippet holds

A snippet has a title, a description, a folder, tags, a favorite star and one or more fragments. Each fragment is a named piece of text with a language, shown as a tab. Use several fragments for things that belong together, such as a docker-compose.yml and the command that runs it.

A snippet is either a command or a code snippet. New snippets are code snippets, except when you create one in the Commands view. Switch with Change to command / Change to code snippet in the snippet’s menu. A new snippet also goes into the folder, tag or Favorites view you are in.

Snipstack saves as you type, after a short pause. The footer shows Saving… and then Saved locally.

Languages

Plain text, Bash, TypeScript, JavaScript, SQL, YAML, JSON, Go, Python, Rust, Dockerfile, Nginx, HTML, CSS, Markdown and PowerShell. Snipstack guesses the language from the fragment name’s extension and from text you paste. Change it with Option+Shift+L or Alt+Shift+L.

Limits

What Limit
Title 500 characters
Description 5,000 characters
Fragment name, folder name 200 characters
Tag name 64 characters
Fragments per snippet 1 to 50
Content per snippet 2,000,000 characters in total

Copying

Action Keys What it does
Copy Cmd+C or Ctrl+C Copies the text as written, with {{variables}} left in place.
Copy rendered Cmd+Option+C or Ctrl+Alt+C If the fragment has variables, opens Fill in variables first. Otherwise the same as Copy.

From the snippet list, these copy the snippet’s first fragment. In an open snippet, they copy the fragment you are on. Snipstack confirms with Copied to clipboard and counts the use, which feeds the Recent view and search ranking.

If text is selected in the list, Cmd+C or Ctrl+C copies the selection as usual.

Smart views

View Shows Keys
All snippets Everything except the Trash Cmd+1 or Ctrl+1
Favorites Starred snippets Cmd+2 or Ctrl+2
Recent Snippets copied in the last 30 days Cmd+3 or Ctrl+3
Commands Command snippets Cmd+4 or Ctrl+4
Untagged Snippets with no tag Cmd+5 or Ctrl+5
Trash Deleted snippets Cmd+6 or Ctrl+6

Sort a list by Recently used, Recently edited (the default; Recently used in the Recent view), A-Z, Most used or Recently created.

The Trash

Delete moves a snippet to the Trash. Trashed snippets are read-only and cannot be copied (Copy, Copy rendered and Fill variables only say the snippet is in the Trash, and search and quick search never show them): open one and click Restore to edit or copy it again.

Nothing is emptied automatically. Empty trash… permanently deletes the snippets that have been in the Trash for more than 30 days; newer ones stay.

Once a device has been connected to a database, Empty trash deletes nothing (“Nothing was old enough to delete”): the Trash is kept on any device that was ever connected, even after you disconnect. While a database is connected, Settings > Data says “Trash is kept on synced devices.”