Caxton
Features Benchmarks Pricing Docs How it works Changelog Support About Download Free
Guide
Getting Started Opening Large Files Find & Replace Filtering CSV Workbench Transform Cells Validate & Repair Column Profiles Sort & Duplicates Editing at Scale Power Editing Navigation & Bookmarks The Sidebar Search Files or Commands The Inspector Log Mode Compare View Themes Sessions & Recovery License
Reference
Keyboard Shortcuts Menu Reference Settings & Storage Encodings
Switching
Coming from EmEditor
Engineering
How Caxton Works Benchmarks How Caxton Is Tested

Power Editing: snippets, brackets, clipboard.

The everyday depth of an editor you live in: comments, brackets, snippets, completion from the document, clipboard history, and rules that set a file up the way you want it when it opens.

This page covers Edit ▸ Snippets…, where you write snippets with tab stops, placeholders and variables that expand on Tab, and Edit ▸ File Pattern Rules…, which sets word wrap, tab width, encoding, the CSV delimiter, the header row or syntax for the files a glob matches. It also covers line and block comment toggling, the commands of Edit ▸ Brackets, Edit ▸ Complete Word, and clipboard history, which keeps what you cut or copied in Caxton and never reads the system pasteboard.

Comments

⌘/ toggles line comments across the selection as one undo step. It is language aware: markers land in a straight column at the shallowest indent, blank lines stay untouched, and uncomment wins only when every non-blank selected line is already commented. ⌥⌘/ wraps or unwraps a block comment. Languages without a line marker, HTML and XML, route ⌘/ to the block pair.

Brackets

Typing (, [, {, or a quote closes the pair with the caret between. Typing the closer walks over the inserted one, and backspace on a fresh pair removes both. Hand-typed closers are never swallowed, quotes stay single against a word character, and a selection wraps instead of being replaced.

The matching bracket at the caret gets a ring highlight. Edit ▸ Brackets carries Jump to Matching Bracket (⌃⌘B), Select Surrounding Pair (⌃⇧⌘B), Delete Surrounding Pair, Change Surrounding Pair To (( ), [ ] or { }), and the Auto-Close Brackets toggle.

Snippets with tab stops

Author snippets in Edit ▸ Snippets…. The list at the left holds your snippets; + adds one and − removes the selected one. For each snippet, Name labels it in the list, Abbreviation is the word that expands on Tab (the list shows it after the name), Languages limits it to comma-separated language ids such as swift, python, html (empty means everywhere), and the large field below is the body. Changes save as you edit.

The Snippets window with one snippet selected, showing its name, abbreviation, languages field and body

The hint under the body lists the tab-stop and variable syntax.

Export… saves every snippet to a JSON file and Import… adds the snippets from one, so a set moves between Macs or to a colleague.

  • $1 to $9 are tab stops, ${1:default} is a placeholder with a default, and $0 is the final caret.
  • A repeated stop is a mirror: it types in every place at once.
  • $DATE, $TIME, $FILENAME, and $CLIPBOARD are variables; \$ is a literal dollar.

Type the abbreviation and press ⇥. The snippet expands as one undo step with the first placeholder selected, ⇥ walks the remaining stops while they track your typing, and ⎋ ends the session. Malformed syntax passes through literally; a snippet never eats text.

Completion from the document

⌥⎋, or Edit ▸ Complete Word, lists identifiers from the file itself in a panel at the caret, most frequent first, matching what you have typed. There is no dictionary and no guessing. The scan is a bounded window around the caret, so it behaves the same in a small config and in a multi-gigabyte log.

Clipboard history

⇧⌘V shows the last 50 things you cut or copied in Caxton, searchable. Return pastes the entry and makes it the live clipboard. With several cursors, ⌥Return spreads a matching multi-line entry one line per cursor.

  • Editor-local by design. It never reads the system pasteboard, so other apps' clipboards are invisible to it.
  • Secrets are excluded. Copies from files that look like secrets (.env, key material, credentials) are never recorded, and entries over 1 MB are not kept.
  • Unpinned entries live in memory and end with the app. ⌘P pins an entry so it survives relaunch, up to 20 pins.

Per-file rules by glob

Edit ▸ File Pattern Rules… holds an ordered list of glob rules that apply at open, including session restore, workspaces, and Reopen Closed Tab. A plain pattern (*.log) matches file names; one with a slash (*/exports/*.csv) matches the whole path.

Each rule can set word wrap, tab width, encoding, the CSV delimiter, the header row, or syntax, and leave the rest inherited. Rules read top to bottom and the first match wins for each setting. The encoding rule applies exactly like Reopen with Encoding, automatically, so the vendor who ships Shift-JIS every week just opens right.

The File Pattern Rules window with a rule for *.log selected and its Wrap, Tab Width, Encoding, CSV, Header and Syntax settings

Every pop-up starts at Default, which leaves that setting to Caxton.

The list at the left holds the rules in order; + adds one for *.log and − removes the selected one. For the selected rule:

  • Pattern: the glob, such as *.log or access-*.txt.
  • Wrap: Default, On or Off.
  • Tab Width: Default, 2, 3, 4 or 8.
  • Encoding: Default, or any encoding Reopen with Encoding offers.
  • CSV: Default, Comma, Tab, Semicolon or Pipe, for files that open in the grid.
  • Header: Default, First row, or None.
  • Syntax: a file extension whose highlighting to use (swift, py, html, log); empty detects it from the file.

Export… and Import… move the rules between Macs as a JSON file; an import adds to the rules you have.

The keyboard you expect

  • With a selection, Tab indents the selected lines and ⇧Tab outdents them, one undo step each.
  • ⌘D selects the word under the caret; each further press adds a cursor at the next occurrence.
  • ⌥⇧ with the arrow keys starts or grows a rectangular selection from the keyboard.

Multi-cursor editing, rectangular selection, the Text toolbox, undo, and saving are covered in Editing at Scale.