Snippets
Snippets are short abbreviations that expand into full content: plain text, rich text (HTML), or executable scripts (Pro). A few letters + trigger key โ full block. Template variables like {{date}}, {{clipboard}} (Pro) are replaced on expand. See FillIn & variables.
How to expand snippets
- Abbreviation & trigger โ Type abbreviation + trigger (default Tab, or Space/Enter etc.) to expand; works in any text field.
- Trigger key: Tab, Space, Enter, Alt,
.,,,;,-,/,=,`configurable; โrequire trigger to expandโ recommended to reduce accidents. - Match modes:
- Left-to-right: Abbreviation must match input exactly (e.g.
sigโsig+Tab) - Right-to-left: Abbreviation only needs to match as suffix (e.g.
mysigโsig+Tab expands) - Word boundary: In right-to-left mode, require a word boundary character before the abbreviation to avoid mid-word triggers
- Adaptive case: Type
SIGto expand uppercase version,Sigfor title case
- Left-to-right: Abbreviation must match input exactly (e.g.
- Inline search: Type
//(configurable prefix) to bring up snippet search popup; arrow keys to select, Enter to insert - Shortcuts (Pro): Global main/search, create from clipboard, new snippet, edit last expanded, expand last again; per-snippet global shortcut. See Settings โ Shortcuts.
Groups & Multi-file
- Tree groups + prefix: e.g. all under
ai-expand asai-xxx; manage many snippets by scenario. See Introduction ยท Snippets. - Multi-file snippets: One snippet, multiple โfilesโ (language/env), each with its own abbreviation and content; maintain once, expand everywhere.
- Add, copy, delete, and drag-to-sort files
- Each file independently has: filename, runtime, abbreviation, content, expand scope, global hotkey
- Multi-file snippets show file count badge in the list
Only in Selected Apps แดพแดฟแดผ
Expand only in selected apps; typing the same abbreviation elsewhere wonโt trigger. Keep expansion in VS Code, Cursor, or browser without triggering in chat or web inputs.
How to Set
- Open snippet or group settings.
- Find ExpandIn (or โExpand only in these appsโ).
- Select or search apps (e.g. VS Code, Chrome, Cursor); multiple allowed.
- Save; that snippet or group only responds to โabbreviation + triggerโ in those apps.
If no app is selected, it applies everywhere.
How It Works
- App detection: Automatically identifies the foreground application; no manual technical configuration needed.
- Group-level limit: Setting ExpandIn on a group applies to all snippets under it.
- Snippet-level limit: Per-snippet settings can override the group for finer control.
- Global search: ExpandIn only affects โabbreviation + triggerโ expansion; the global search window (shortcut-activated) is always available everywhere.
Typical Scenarios
| Scenario | Suggested Setup |
|---|---|
| IDE-only code snippets | Group set to VS Code / Cursor / JetBrains only; abbreviations like log, try wonโt trigger in chat apps |
| Browser AI prompts | Snippet set to Chrome / Safari / Edge only; expand prompts in AI chat sites |
| Office doc templates | Group set to Lark / Notion / Docs only; weekly reports and meeting notes only trigger in document tools |
| Same abbr, different apps | Same abbreviation expands differently per app: deploy expands Shell command in Terminal, deployment doc template in documents |
Notes
- Unrecognized apps: If an app canโt be detected (some Electron apps), ExpandIn may not work; disable the restriction for those snippets.
- Performance: ExpandIn checks the foreground app before each trigger; overhead is negligible.
- Combine with word boundary: Enable โword boundary checkโ to avoid mid-word triggers within the allowed apps.
Best for: Heavy snippet use in IDE and browser without triggering in chat (e.g. WeChat, Slack).
Snippet Editor
Editor Types
Switches automatically based on snippet runtime:
- Code editor: Syntax highlighting for all major programming languages, line numbers, undo/redo, and theme switching. Great for code wrappers and script snippets.
- Rich text editor: Bold, italic, headings, lists, tables, images, links, and alignment. Great for email templates, documentation, and formatted content.
Editor Toolbar
| Shortcut | Action |
|---|---|
Cmd/Ctrl+Shift+L | Toggle read-only / edit mode |
Cmd/Ctrl+Shift+P | Run / preview snippet |
Cmd/Ctrl+Shift+Backspace | Delete current file |
Read-only hint: When a snippet is locked (read-only mode), hover over the editor area and the lock icon will flash as a reminder โ click it or press Cmd/Ctrl+Shift+L to unlock and edit.
Typical Scenarios
- Developers: Write code wrappers (try/catch, logging) with syntax highlighting; run scripts directly and copy output.
- Technical writers: Draft documentation in rich text with images and tables; screenshot and annotate in the same app.
- Multilingual teams: Share snippets across regions โ code snippets work in any IDE, templates adapt to local languages via FillIn.
Code to Image
- Carbon share: Render code as beautiful image (Carbon.now.sh)
- Local render: Code to image (local rendering)
FillIn & Template Variables
- FillIn variables โ Popup on trigger: single/multi-line, dropdown, checkbox,
%date%, cursor%c%(multi-cursor tabstop supported), clipboard%cv%, nested%s:abbr%; great for prompts and parameterized templates.- Variable case formatting:
camel/pascal/snake/kebab/upper/lower
- Variable case formatting:
- Snippet template variables (Pro) โ In content:
{{date}},{{time}},{{clipboard}},{{cursor}},{{input}}; replaced on expand.
Snippet Types & Execution แดพแดฟแดผ
Built-in Types
| Type | Description |
|---|---|
plain | Plain text (default) |
rich | Rich text (HTML) |
shell | Shell script |
applescript | AppleScript (macOS) |
js | JavaScript |
python | Python |
Custom Runtime
Configure custom runtimes in Settings to run any executable. Supports passing snippet content, clipboard, and selected text into the execution context, plus custom wrapper templates for pre/post-processing.
Execution Methods
- Preview: Click run button or
Cmd/Ctrl+Shift+Pin editor; results shown in bottom panel - Run and copy: Right-click in snippet list โ โRun and copyโ; result copied to clipboard after execution
Version History
Auto-saved version history per file:
- Auto-save: Edits are automatically saved to history as you work
- Version sources: Initial creation, auto-save, manual save, and apply operations
- Version diff: Side-by-side visual comparison; review line-level or formatted differences
- Restore: Roll back to any previous version with one click
Typical recovery scenarios:
- Accidental deletion โ recover from history in seconds
- Compare changes โ see exactly what changed between edits
- Experimental edits โ try new ideas safely, roll back anytime
Share & Sync
- Share link: Snippets can generate share links (
rawurl); right-click to copy or open - Cloud sync: Push/Pull individual snippets to GitHub/Gitee Gist
- Import/Export: Supports JSON, CSV format import/export