Snipsy
Snipsy vault/Snipsy

Snipsy

Properties
plugin id
snipsidian
defaults
todonotetodayh1boldbrb
needs templater
mobile
version
1.10.0 · Obsidian 1.5.0 or later
license
MIT

Type todo and a space, get - [ ]. Hotstrings and regex patterns for Obsidian, markdown-aware, no scripting.

A trigger expands when a separator lands after it. The separator stays where you typed it, and the caret goes where the snippet says.

What is in it

Where it stays out of the way

Not in fenced code, not in inline code, not in math, not in frontmatter, not in the middle of a word. Only real typing expands: a paste, an undo or another plugin's edit never does. The full list.

Install.md

Install

Snipsy is in Obsidian's community plugin catalog.

  1. Settings›Community plugins›Browse
  2. Search for Snipsy, then Install and Enable.
  3. Open any note, type todo and a space. The line becomes - [ ] with the caret after it.

Insert snippet…

For a snippet whose trigger you do not remember, run Snipsy: Insert snippet… from the command palette (Ctrl/Cmd P). It searches your triggers and shows the whole expansion before you pick one. With text selected, the same picker opens as Wrap selection.

snipsy
  • Snipsy: Insert snippet…
  • Snipsy: Add snippet from selection
  • Snipsy: Expand trigger at cursor
  • Snipsy: Next field
  • Snipsy: Open settings
Insert snippet
no
  • note(Defaults)> [!note] ↵ >
  • now(Defaults)$time
Preview
> [!note]
> 

A sketch of the picker: the query, the matching triggers with their group, and a preview of the one under the cursor. Command id insert-snippet.

The Insert snippet dialog over a note: the query da, seven matching triggers with their groups, and a preview of the highlighted one
Insert snippet with da typed. The query matches triggers, replacements and group names, and the preview shows the highlighted snippet.

The other commands

Add snippet from selection turns the selected text into a snippet: you only type the trigger. Expand trigger at cursor expands the trigger right before the caret without a space, with the same rules as typing; with no trigger there and a snippet's fields open, it jumps to the next field, so one key does both. Next field jumps to the next field, for a phone toolbar or a keyboard without Tab. Open settings opens Snipsy's settings. None of them has a default hotkey.

A hotkey

To put a key on any of them, go to Settings›Hotkeys and search for "snipsy". Or use Set hotkey for Insert snippet in Snipsy's settings: it opens that screen with the search already filled in.

On a phone

The same snippets expand as you type on mobile, and the same picker opens. To reach it with one tap, add Snipsy: Insert snippet… to the editor toolbar under Settings›Toolbar. Add Snipsy: Next field there too to move between a snippet's fields without a Tab key.

A task by trigger, a date from the picker.

On Obsidian 1.13 and later the settings are native: Snippets and Packages open as pages, everything else sits on the Snipsy settings screen, and Obsidian's settings search finds them. Older Obsidian shows the same settings as Snippets, Packages, General and About tabs.

Snipsy settings on Obsidian 1.13: Snippets, Patterns and Packages entries with their counts (Patterns: 32 rules), then the Expansion group with its switches
The Snipsy settings screen on Obsidian 1.13.
Defaults.md

Sixteen defaults, one group

A fresh install comes with these, all in one group called Defaults. marks where the caret lands, ↵ is a line break.

WORDS
brb→be right back omw→on my way ty→thank you imo→in my opinion
HEADINGS AND TASKS
h1→# h2→## h3→### todo→- [ ] done→- [x]
INLINE
bold→**** italic→__ code→``
BLOCKS
note→> [!note]↵> table→| H1 | H2 | H3 |↵
| --- | --- | --- |↵
| | | |
DATE AND TIME
today→$dateYYYY-MM-DD now→$timeHH:MM
Not your words? Delete them

Delete the group and the defaults stay deleted, through restarts and updates. Settings›Snipsy›Restore default snippets brings back the missing ones and leaves yours alone: a trigger that already exists in any group is skipped.

Writing snippets/Your first snippet.md

Your first snippet

  1. Settings›Snipsy›Snippets›Add snippet
  2. Trigger: sig. Type :sig out of habit and the dialog corrects you under the field: Will expand when you type: sig.
  3. Replacement: two lines, Best, and your name. Save.
  4. In a note, type sig and a space.

Or start from text you already wrote: select it and run Snipsy: Add snippet from selection. The replacement is filled in, so you only name the trigger.

From a selection to a working trigger.
Add snippet
trigger: sig
replacement: |
  Best,
  Dmitriy
renders as

The two fields above are what you fill in; the dialog is a form, not YAML. The caret ends up after the last character, with the space you typed still after it.

The Add snippet dialog: trigger :sig, the hint Will expand when you type: sig, replacement Best, then Dmitriy on a second line, group work
Typing :sig in the Trigger field: the hint says the snippet will fire on sig, because the colon is stripped.
Writing snippets/Placeholders.md

Placeholders

A replacement is plain text with a few words that fill in when it expands.

$| where the caret lands. Without it, the caret goes after the text.
$date today, as YYYY-MM-DD.
$time the time now, as HH:mm.
{{date:FORMAT}}, {{time:FORMAT}} a formatted date or time, the same syntax as core Templates. {{date}} alone is YYYY-MM-DD.
$filename the file name of the note you are typing in, with its extension.
$clipboard what is on the clipboard, read at the moment the snippet expands.
$1 to $9 fields: Tab jumps from one to the next, Shift+Tab goes back, and the last Tab lands on $|, or after the text. A snippet with a single $1 just puts the caret there. Over a selection in Insert snippet…, the first $1 takes the selected text.
replacement
## $filename, $date $time
- $|
renders as
Fields only count with two or more

With two or more of $1 to $9, Tab walks them ([$1]($2) opens with the caret between the brackets). Tab is taken only while that walk is open, so a list item still indents. Prices like $1.50 or $1,000 and anything inside code stay as typed; write \$5 for a literal $5.

Writing snippets/Groups.md

Groups

Every snippet lives in a group. The defaults are one, and each pack or import you add gets its own.

  • The toggle on a group header mutes the whole group: its triggers stop expanding and leave the picker. The group stays in the list, dimmed, and you can still edit it.
  • Select several snippets to move or delete them together.
  • Deleting asks first, and names the first five triggers it is about to remove.
The Snippets page in selection mode: the Callouts group muted and dimmed with its toggle off, and three Meetings snippets selected with a bar offering Move to group, Delete and Clear
Callouts is muted: dimmed, its toggle off. Three meeting snippets are selected, ready to move or delete together.
Writing snippets/Patterns.md

Patterns

A trigger is a fixed word. A pattern is a regular expression that has to end at the caret, so it can match a shape: 1/2, -->, :work:. Settings›Snipsy›Patterns lists the rules, and each one is Instant (fires as soon as the text matches) or After a separator (fires on a space, Enter or punctuation, so 1/23 can still be typed).

patterns
/\b1\/2$/        →  ½
/-->$/           →  →
/:(\w+):$/       →  #{{1}}
/mtg (\w+)$/i    →  Meeting with {{1}} at $1 about $2
you type
1/2␣→½␣ -->→→ :work:␣→#work␣ mtg Bob␣→Meeting with Bob at $1 about $2
Add the typography set, then type 1/2 and a space, and -->.

In the replacement, {{1}} to {{9}} are what the groups matched, {{0}} the whole match and {{name}} a named group. $1 is still a Tab stop, so the two never mix. Captured text goes in last and as plain text.

  • Literal triggers go first, then rules from the top of the list. The first match wins.
  • The expansion is one undo step, and it stays quiet in code, math and frontmatter.
  • Try it replays a line through the real engine and tells you what fires, and when an instant rule fires too early.
  • Add typography set adds 32 rules: fractions, arrows, ≠, ≤, ≥, ±, … and more.
Checked before they run

A pattern has to end with $, and only the flag i is allowed. Shapes that can backtrack without limit, such as (a+)+$, are refused when you write them, with the reason. Backreferences, lookahead and Unicode property classes are refused too. A rule that turns out slow while you type is paused for the session. Up to 100 rules.

The Patterns page with the first rule open: the pattern for 1/2, the replacement ½, Fires set to Instant, and Try it with 1/23 showing ½3 and the message that it fired at 1/2, before 3
Try it on 1/23 with the rule set to Instant: it fires at 1/2 and leaves the 3 behind. After a separator lets 1/23 finish.

The exact rules and every refusal are in the reference.

Behaviour/How expansion works.md

How expansion works

A trigger expands when a separator lands right after it. These count as separators:

SpaceTabEnter.,!?;:()[]{}"'

The separator stays where you typed it. Type brb and a comma, and you get be right back,. A snippet that spans lines puts the caret on the line it names, so note leaves you inside the callout, ready to write.

brb,→be right back, note␣→> [!note]↵> ␣
renders as
Behaviour/Where it stays quiet.md

Where it stays quiet

Snipsy never expands:

  • inside a fenced code block
  • inside inline code
  • inside math, $…$ and $$…$$
  • in YAML frontmatter
  • in the middle of a word: photodo is left alone

Since 1.3.0 only real typing triggers it. None of these expand, even when they end in a trigger:

  • a paste
  • undo and redo
  • drag and drop
  • another plugin's edit
  • IME composition, so Chinese, Japanese and Korean input works as usual
One undo takes it back

Press undo right after an expansion and it takes back the trigger and the expansion together, in one step.

Behaviour/Prefix mode.md

Prefix mode

For writers who kept getting now and today expanded in the middle of a sentence. In Settings›Snipsy›Expansion, turn on Require a prefix before triggers and pick : or ;.

todo␣→todo␣stays a word :todo␣→- [ ] ␣

The prefix is consumed: it does not stay in the note. It is one switch for every trigger, and it is off by default.

In the same place, Highlight expansions underlines the text an expansion just inserted. Press Backspace right away and the trigger comes back, so brb␣ turns into be right back␣ and back again. Move the caret or keep typing and the underline goes. Off by default.

Prefix mode on: now stays a word, :now expands.
Highlight expansions on: Backspace restores the trigger.
The Expansion settings: Expand while typing on, Expand on Tab off, Require a prefix before triggers switched on, the prefix character set to a colon and Highlight expansions off
General › Expansion with the prefix required and : as the prefix character.
Packages/Community catalog.md

Community catalog

Settings›Packages lists ready-made packs from the catalog repository. One click installs a pack into its own group; uninstalling deletes that group.

Markdown Essentials Obsidian Power-User Daily Journal GTD & Productivity Meetings Developer Boilerplate Code Review Research & Academic Symbols & Math Date & Time Obsidian Callouts Basic Emojis Typography

Reinstall a pack whose snippets you have edited, and a preview asks before anything is written: keep yours, or overwrite it. A pack that wants a trigger used by a different snippet in another group is not installed, and the notice names the trigger. The list is cached for 24 hours, and works offline from that cache.

Install, Apply, then type the trigger.

Have a set worth sharing? Submit it from the plugin, and Snipsy opens a GitHub issue with it already filled in.

The Packages page: a filter box and a list of community packs, each with its description, author, version, snippet count and an Install button
The Packages page, loaded from the catalog repository.
The install preview for Daily Journal: 7 new snippets and one conflict on grtd, showing the current and incoming text with a Keep current or Overwrite choice
Reinstalling Daily Journal after editing its grtd snippet. The preview lists the conflict and asks: keep current or overwrite.
Packages/Espanso import.md

Espanso import

Paste an Espanso .yml, from hub.espanso.org or your own config, name the group, and press Import snippets.

base.yml
matches:
  - trigger: ":sig"
    replace: "Best,\nDmitriy$|$"
  - trigger: ":paste"
    replace: "> {{clipboard}}"
  - trigger: ":ymd"
    replace: "{{d}}"
    vars:
      - name: d
        type: date
        params:
          format: "%Y-%m-%d"
  - trigger: ":ask"
    form: "Hi [[name]]"
imports as
sig→Best,↵Dmitriy$| paste→> $clipboard ymd→$date
The report

3 imported, 1 skipped: ask, followed by why.

$|$ becomes $|, {{clipboard}} becomes $clipboard, and a plain date variable becomes $date or $time. Forms, scripts, shell commands and images have no Snipsy equivalent. They are skipped and listed by name, instead of arriving broken. The same size limits apply as for a catalog install.

regex: matches become pattern rules. The preview lists them in their own section with the pattern, the replacement and the mode, or the reason one was left out. (?P<name> becomes (?<name> and {{name}} is the capture of that name. A rule that uses a feature patterns refuse, such as lookahead or a backreference, is skipped and named. Espanso reads \w and \d as Unicode and a pattern as ASCII, so a rule can match differently on non-ASCII letters.

The Espanso import section with a pasted file of four matches and the result line 3 imported, 1 skipped: ask
The YAML above, pasted and imported: three snippets land in the Espanso base group, and the form-based ask is skipped by name.
Packages/Text Snippets import.md

Text Snippets import

Coming from the Text Snippets plugin? Its last release was in 2022. On the Packages page, press Import under Text Snippets import. Snipsy reads that plugin's saved snippets, shows a preview, and copies them into a text-snippets group. The other plugin's files are only read, never changed.

Text Snippets
sig : Best,$nl$Dmitriy
lnk : [[$end$]]
mtg : Meeting with $tb$ at $tb$
прив : Привет!
imports as
sig→Best,↵Dmitriy lnk→[[$|]] mtg→Meeting with $1 at $2 прив→Привет!

$end$ becomes the caret $|, $nl$ a line break, $pst$ becomes $clipboard, and $tb$ stops become fields you walk with Tab. Custom marker symbols are read from that plugin's settings. Triggers in any script come across (прив, δ, café, 日付); emoji, spaces and invisible characters are skipped, and the preview says why.

Two differences

Snipsy expands as you type, after a space, Tab, Enter or punctuation, instead of waiting for a key. If you prefer a key, bind Expand trigger at cursor to the one you used. Custom word delimiters cannot be carried over: Snipsy has a fixed set, and the import tells you when yours differed.

Packages/Backup.md

Backup

Export snippets and Import snippets in Snipsy's settings move your snippets and your pattern rules as one JSON file. Merge adds the rules you do not have yet, Replace all swaps the whole list. Older Snipsy versions import the snippets and do not get the rules. On mobile, export writes snipsidian-snippets.json to the root of the vault, and falls back to the clipboard when it cannot.

Privacy.md

Privacy

Snipsy works offline, apart from the Packages page. Everything it keeps is in one file: .obsidian/plugins/snipsidian/data.json.

The only network calls

Both happen on the Packages page:api.github.com for the list of packs, raw.githubusercontent.com for the pack files, kept for 24 hours. No analytics, no telemetry, no account.

$clipboard reads the clipboard only when a snippet containing it expands. None of the defaults use it.

What it leaves out.md

What it leaves out

Snipsy replaces a word with text. It does not do these, by design:

  • templates with JavaScript (see Templater)
  • expansion outside Obsidian, in every app (see Espanso)
  • a snippet library you search but never type (see Snippets Manager)
  • patterns with backreferences, lookahead or Unicode property classes (see Patterns)
  • scripting of any kind

If one of these stops you, say what you tried.

Questions.md

Questions

Does it work on my phone?

Yes. The plugin is not desktop-only. Triggers expand on mobile the same way, and the picker can sit on the editor toolbar. On a phone.

Can I use regular expressions?

Yes. Add a rule under Settings›Snipsy›Patterns: /\b1\/2$/ turns 1/2 and a space into ½. Try it shows what fires before you save. Patterns.

Will it fire in my code blocks?

No. Fenced code, inline code and frontmatter are left alone. Where it stays quiet.

now keeps expanding in my sentences

Three ways out. Delete that one snippet. Mute the whole Defaults group with its toggle. Or turn on prefix mode, and only :now expands.

Does it send my text anywhere?

No. Your snippets stay in data.json in your vault. The only network traffic is the pack list and pack downloads on the Packages page. Privacy.

Can I bring my Espanso snippets?

Yes. Paste the .yml. What Snipsy can map comes across, and what it cannot is listed by name. Espanso import.

How do I report a bug?

Open an issue on the issue tracker. Your Obsidian version, your OS and the trigger involved help the most.

Also by the author: Dashy

A dashboard inside an Obsidian note, built from six markdown blocks: tiles, number cards, progress bars, countdowns and a year heatmap. A few lines of YAML each. No JavaScript, no Dataview.

If Snipsy is useful to you

Snipsy is free and made by one developer. A star on GitHub tells others the plugin is worth a look, and a coffee is a way to say thanks.