Skip to Content
Documents📖 Reference🧩 FillIn variables

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

FillIn ¡ /cs support
Enter / Tab next field

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.

FillIn ¡ single line
OK ⌘↩

%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.

FillIn ¡ multi-line
OK ⌘↩

%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%

A ticket template only allows High / Medium / Low. Expansion shows a menu. Pick one, then insert.

FillIn ¡ menu
OK ⌘↩

%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.

FillIn ¡ optional
Note: visible in FillIn only, not inserted
OK ⌘↩

%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 this

Conditional sections

Support needs both a refund line and a replacement line. One snippet: pick Refund or Replacement, and only that branch is sent.

FillIn ¡ switch
OK ⌘↩

%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.

FillIn ¡ date
OK ⌘↩

%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 world

2. %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

VariableDescription
%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:

  1. Caret is placed after SELECT
  2. Press Tab to jump after FROM
  3. 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:

ParameterExampleEffect
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 → Output

Shortcuts

ShortcutAction
Cmd/Ctrl + EnterConfirm and insert
Enter / TabNext field

Content types

TypeDescription
plainPlain text
richRich text (HTML)
shellShell (run and output)
jsJavaScript (run and output)
pythonPython (run and output)
applescriptAppleScript (macOS)
powershellPowerShell (Windows)
Last updated