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.
The main window is three panes: groups on the left, the snippet list in the middle, the editor on the right. Locked Organization groups cannot be edited on the desktop.
Main window: groups โ snippets โ editor. Organization groups are locked read-only.
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, line numbers, undo/redo. Great for code wrappers and script snippets.
- Rich text editor: bold, italic, headings, lists, tables, images, links. Great for email templates 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 |
powershell | PowerShell (Windows) |
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
Groups & prefix
The left pane is the group tree. Snippets live in groups; abbreviations live on files; prefixes live on groups.
- Right-click empty space โ New group, or add a child under a group.
- Group settings: name, prefix (e.g.
ai-). Prefixai-+ file abbrgenโ typeai-genthen the trigger. - Free: about 5 groups; Pro unlimited. A child group can have its own prefix. Save after you change it.
A group can also set ExpandIn / expand-when / local trigger keys (not synced), and whether it uploads. Locked Organization groups cannot be edited on the desktop. See Organizations and Expand.
Create & edit
Support wants a return-policy line as ret. Pick one of your groups, create a snippet, type the body, save. Next time, type ret and Tab in the email.
- Select a Just me group (a locked org group cannot be edited here).
Cmd/Ctrl+N, or click New. Free stops around 50 snippets.- Name it; set the abbreviation and body on a file. Choose plain text, rich text, or a script (Pro).
- Save. A new abbreviation or group prefix works the next time you type.
Also: create from clipboard, drop a file, accept a suggested snippet, or open a share pack. One snippet can hold a Chinese and an English signature, each with its own abbreviation.
Suggested snippets
You typed the same sign-off three times today. The main window may ask: save this as an abbreviation? Preview it, then confirm. If you ignore it, the library does not change. Confirm to add it to the current group. The Free ~50 cap still applies. Counts stay on this computer.
Share pack
Bundle groups/snippets for a coworker. They confirm in-app; items land in their local library, not live org sync.
- Open
codeexpander://import?d=...(over-long payloads are rejected). - The app shows a confirm dialog after decode. Only then it writes. Free-tier caps still apply.
- Packs that point at shared org snippets are recognized; copy to my library makes an editable personal copy.
Export lives on snippet/group menus and Data โ Transfer. A share pack is not CE Cloud organization access. See Deep links.
Share & Sync
- Personal CE Cloud / Organizations / Gist & WebDAV.
- Import/Export: Settings โ Data; JSON and TextExpander export.