FillIn Template Variables
FillIn is CodeExpanderâs form-on-expand feature: insert FillIn variables in a snippet (e.g. %filltext%, %fillarea%); on expand a popup opens for you to fill, then variables are replaced. Good for prompts, email templates, parameterized code blocks.
Single line ¡ Multi-line ¡ Popup ¡ Optional ¡ Conditionals ¡ Dates ¡ Syntax
A FillIn window appears before expansion. â/Ctrl+Enter inserts.
Single-line field
A support template needs the customerâs name. Expansion opens one field. Type âLeeâ once; every blank with that name becomes Lee.
%filltext%: one line. Same name is filled once. â/Ctrl+Enter confirms.
Editor toolbar FillIn â Single line. Give the field a name. Same name is filled once. Fill the line, then â/Ctrl+Enter.
Hello, %filltext&name=username&default=World&width=150%!Multi-line field
A return email needs three lines of reason. Expansion shows a taller box. Fill it, then the paragraph lands in the message.
%fillarea%: multiple lines. default may contain a literal %.
Editor FillIn â Multi-line. A default can include a percent sign (6% VAT).
%fillarea&name=description&default="Please describe"&width=300&rows=5%Popup menu
A ticket template only allows High / Medium / Low. Expansion shows a menu. Pick one, then insert.
%fillmenu%: predefined opt values. Optional checkbox.
Editor FillIn â Menu. You need at least one option. For a whole paragraph that changes with the choice, use conditionals.
Priority: %fillmenu&name=priority&default=Medium&opt=High&opt=Medium&opt=Low&width=80%Optional & notes
Some emails add âplease prioritizeâ only when urgent. Check the box and that phrase is inserted; leave it unchecked and it stays out.
%fillcheck% outputs only if checked; %fillnote% is editor-only.
Checkbox inserts the default text only when checked. Notes show in the form only and never in the sent body. Editor FillIn â Optional / Note.
%fillcheck&name=urgent&default=[Urgent]&isCheck=0% Please handle thisConditional sections
Support needs both a refund line and a replacement line. One snippet: pick Refund or Replacement, and only that branch is sent.
%fillswitch% / %fillcase%: Branch i/n outputs only the current branch.
Editor FillIn â Conditional. The form switches branches. The /cs snippet in + â template examples â Support replies is a full example.
%fillswitch&name=case%
%fillcase&opt=Refund%
Refund is in. Order %filltext&name=order&default=%.
%fillcase&opt=Replacement%
Ship it back with order %filltext&name=order&default=% on the note.
%fillend%Dates & time
A contract needs a due date. Expansion opens a calendar. If it is always âtodayâ, use the automatic date â no popup.
%filldatepicker% opens a calendar; %date% inserts today with no popup.
Pick a day:
Due %filldatepicker&name=due&format=LL%Today or a few days later (no calendar):
Today is %date&format=LL%
Tomorrow is %date&format=LL&calc=1%Formats: Date %date%.
Variable Types
1. %filltext% â Single-line text
Format:
%filltext&name=id&default=value&width=px%Parameters: name required; default, width (default 100), case optional.
Example:
Hello, %filltext&name=username&default=World&width=150%!Variable case formatting:
// After typing "hello world", output is converted according to case parameter:
camel: %filltext&name=var&case=camel% â helloWorld
pascal: %filltext&name=var&case=pascal% â HelloWorld
snake: %filltext&name=var&case=snake% â hello_world
kebab: %filltext&name=var&case=kebab% â hello-world
upper: %filltext&name=var&case=upper% â HELLO WORLD
lower: %filltext&name=var&case=lower% â hello world2. %fillarea% â Multi-line text
Format: %fillarea&name=id&default=...&width=...&rows=N%
Parameters: name required; default, width, rows (default 2) optional.
default may contain a literal % (e.g. Includes 6% VAT). & still needs %26. The insert panel encodes for you; you can also write %25 for %.
3. %fillnote% â Comment (no output)
Format: %fillnote&name=id&default=comment&width=...%
Shown in editor only; removed from output.
4. %fillcheck% â Checkbox
Format: %fillcheck&name=id&default=value when checked&isCheck=0|1&width=...%
Example: when checked inserts default; when unchecked inserts nothing (or empty).
5. %fillmenu% â Dropdown
Format: %fillmenu&name=id&default=option&opt=Option1&opt=Option2&...%
Parameters: name, opt (one or more) required; default, isCheck, info, width optional.
6. %fillswitch% â Conditional branch
Pick a branch in the FillIn window with a compact Branch i/n control (other fields show or hide with the current branch). Only that branch is inserted. In the snippet editor you type between two markers; the code editor shows one branch at a time and the leading control switches branches. %fillcase is not a separate field.
%fillswitch&name=case%
%fillcase&opt=Refund%
Refund is in. Order %filltext&name=order&default=%.
%fillcase&opt=Replacement%
Ship it back with order %filltext&name=order&default=% on the note.
%fillend%The /cs snippet in + â template examples â Support replies is a full example.
7. %filldatepicker% â Calendar pick
Format: %filldatepicker&name=id&format=ll&lang=en&width=160%
Opens a calendar in the FillIn window. Not the same as %date%, which always inserts today (or today plus calc/expr).
Parameters: name required; format (dayjs tokens, default ll), lang, width optional.
Due %filldatepicker&name=due&format=LL%Date %date%
Format: %date&format=...&lang=...&calc=days offset%
Common formats: YYYY-MM-DD, YY-M-D, HH:mm:ss, L / LL / LLL / LLLL (localized).
expr is an alternative to calc (donât use both): today, tomorrow, next Monday, last Friday, +3d, -2w, +1m (months), +1h, +1min (minutes; min before m), +1s, +1y+1m, +3bd (business days). Encode space as %20 and + as %2B.
Keyboard %clavier%
Format: %clavier&key=key&modifier=mod%
Presets: %clavier&key=Enter%, %clavier&key=Escape%, %clavier&key=Tab%
Custom: %clavier&key=V&modifier=command% (Cmd+V)
Function variables
| Variable | Description |
|---|---|
%c% | Cursor position â caret stays here after expand. Multiple %c% supported for multi-cursor tabstop jumping |
%cv% | Clipboard content â insert current clipboard text (format params supported, see below) |
%s:abbr% | Nested snippet â insert content of snippet with that abbreviation |
Example:
function %filltext&name=funcName&default=myFunction%() {
%c%
}Multi-cursor Tabstop (multiple %c%)
You can use multiple %c% in a snippet. After expansion, the caret is placed at the first %c%; press Tab (or the tabstop jump key configured in Settings) to jump to the next cursor position in sequence.
Example:
SELECT %c% FROM %c% WHERE %c%;After expansion:
- Caret is placed after
SELECT - Press Tab to jump after
FROM - Press Tab to jump after
WHERE
Great for code templates that require filling multiple placeholders in order.
%cv% format parameters
%cv% accepts optional parameters to format clipboard content before inserting â especially useful in AI prompt templates:
| Parameter | Example | Effect |
|---|---|---|
xml=TAG | %cv&xml=error% | Wraps as <error>content</error> |
md=LANG | %cv&md=python% | Wraps as Markdown code block ```python\ncontent\n``` |
md= | %cv&md=% | Wraps as code block without language tag |
truncate=N | %cv&truncate=2000% | Truncates to N characters (appends ... when cut) |
trim=1 | %cv&trim=1% | Strips leading/trailing whitespace |
Parameters can be combined. Processing order: trim â truncate â xml/md. When both xml and md are present, xml takes precedence.
AI prompt examples:
# Debug this error (copy the error first, then trigger the abbreviation)
Here is the error:
%cv&xml=error&truncate=3000%
Please help me find the root cause.# Code review (copy the code first, then trigger the abbreviation)
Please review this code:
%cv&md=python&trim=1&truncate=4000%FillIn Window
Flow
User types abbreviation â FillIn detected â Form opens â User fills â Variables replaced â OutputShortcuts
| Shortcut | Action |
|---|---|
Cmd/Ctrl + Enter | Confirm and insert |
Enter / Tab | Next field |
Content types
| Type | Description |
|---|---|
plain | Plain text |
rich | Rich text (HTML) |
shell | Shell (run and output) |
js | JavaScript (run and output) |
python | Python (run and output) |
applescript | AppleScript (macOS) |
powershell | PowerShell (Windows) |