Skip to content
All guides

Snippets

2 min read

A snippet is a short code that expands into a longer piece of text. Type ;addr in any app to insert your address, or find the same snippet in the search window and press .

Create a snippet

  1. Open Settings > Snippets and click Add

    You can also type the text you want into the search window. If nothing matches, Mochi offers to create a snippet from it.

  2. Enter a trigger

    This is the short code you will type. All triggers start with ; by default. You can change the prefix in the same settings page.

  3. Enter the text it expands to

    Any length, and any number of lines. Use the buttons below the field to insert tokens such as {date}.

Tokens

TokenInserts
{date}Today's date, in your local format
{time} and {now}The current time
{datetime}The date and time
{today}, {tomorrow}, {yesterday}Those dates
{date:yyyy-MM-dd}The date in a format you choose
{date+7d}A date offset from today. Use h, d, w, mo or y
{clipboard}The current clipboard contents
{uuid}A new UUID
{cursor}Where the cursor is placed after the snippet is inserted

Turn on expansion while typing

Expansion while typing is off by default and requires the Accessibility permission. Turn it on in Settings > Snippets > Expand as I type. Using snippets from the search window needs neither.

When snippets do not expand

Expansion is skipped in these situations, by design:

  • In password fields. macOS marks these, and Mochi checks on every keystroke.
  • Inside Mochi's own search window, so you can search for a snippet by its trigger.
  • After you press an arrow key, , or , click somewhere, switch apps, use a shortcut, or stop typing for 20 seconds. In each case the cursor may have moved, so Mochi discards what it has.
  • When the snippet expands to nothing. Mochi checks this before deleting your trigger text.

Insert a snippet from the search window

Type snip: or the snippet's keyword. Mochi searches keywords first, then snippet names, then the snippet text, so you can find a snippet by a phrase you remember from it. Press to paste it into the app you were using. If Mochi cannot paste, it copies the snippet instead and tells you at the bottom of the window.

How many snippets you get

Ten with the free version, and an unlimited number with Pro. If a licence expires, existing snippets keep working. Only creating new ones beyond ten is blocked.