Skip to content

Search and Replace

BeetleBot edited this page May 16, 2026 · 2 revisions

Search and Replace

Fount provides a powerful search and replace system with real-time highlighting, match navigation, and both single and bulk replacement.


Starting a Search

There are two ways to search:

1. Quick Search (from Command Mode)

Type /search [text] and press Enter:

/search BEETLE

This immediately:

  • Highlights every occurrence of "BEETLE" in the script
  • Jumps to the first match after your cursor position
  • Shows "Match X of Y" in the status bar

2. Interactive Search

Type /search (without text) and press Enter. This opens Search Mode, where:

  • You type characters and matches are highlighted in real-time
  • The match counter updates as you type
  • Press Enter to confirm the search and jump to the first match
  • Press Esc to cancel

Navigating Between Matches

Once a search is active (matches are highlighted in yellow), use:

Shortcut Action
Alt+Down Jump to the next match
Alt+Up Jump to the previous match

When you reach the last match and press Alt+Down, the search wraps around to the first match. The status bar shows Search Wrapped ( Match 1 of 7 ) to let you know you've cycled.

Note: Match navigation also works in Search Mode before you press Enter.

Dynamic Shortcut Hints

Starting in v0.9.9, Fount provides dynamic shortcut hints in the status bar (bottom right) whenever a search is active. This ensures you always know how to navigate and replace matches without leaving the screen.

  • Alt+↑↓ Navigate
  • r Replace
  • R Replace All

These hints replace the standard "F1 Help" label to keep the UI clean and focused on your current task.


Search Behavior

  • Case-insensitive: Searching for "beetle" matches "BEETLE", "Beetle", and "beetle".
  • Regex-escaped: Special characters are treated literally. Searching for "INT." matches the exact string INT., not a regex pattern.
  • Persistent highlights: After a search, matches stay highlighted until you press any editing key (a letter, number, etc.) or start a new search.

Replacing Matches

Once you have search highlights active, you can replace text:

Replace Current Match

Press r (lowercase) while on a highlighted match. Fount will:

  1. Enter Replace Mode — the command bar shows Replace with:
  2. You type the replacement text
  3. Press Enter to confirm
  4. The current match is replaced, and highlights are cleared

Replace All Matches

Press R (Shift+R) while search highlights are active. Fount will:

  1. Enter Replace All Mode — the command bar shows Replace all with:
  2. You type the replacement text
  3. Press Enter to confirm
  4. Every match in the script is replaced at once
  5. The status bar shows Replaced N occurrences

Tip: Both replace operations are fully undoable with Ctrl+Z.


Workflow Example

Here's a typical search-and-replace flow:

  1. Press / and type search JOHN → Enter
  2. Fount highlights all occurrences of "JOHN" (e.g., "Match 1 of 12")
  3. Use Alt+Down / Alt+Up to review each match in context
  4. When you find one to change, press r → type JONATHAN → Enter
  5. Or press R to change all 12 at once → type JONATHAN → Enter

Dismissing Search Highlights

Search highlights are automatically dismissed when you:

  • Press any regular editing key (a character, number, etc.)
  • Start a new command with /
  • Click somewhere with the mouse

They are not dismissed by:

  • Alt+Up / Alt+Down (match navigation)
  • r / R (replacement commands)
  • Ctrl+C / Ctrl+W (copy and close — preserved for safety)

Next: Index Cards — Visualize your story structure.

Clone this wiki locally