Skip to main content
Fresh provides powerful search and replace functionality for both single files and entire projects, with support for regular expressions, capture groups, and interactive replacement. The fastest way to search in the current buffer:
ShortcutAction
Ctrl+FOpen search prompt
F3Find next match
Shift+F3Find previous match
EscClose search prompt
1

Open search

Press Ctrl+F to open the search toolbar at the bottom of the screen
2

Enter search term

Type the text you want to find
3

Navigate matches

Use F3 to jump to the next match, or Shift+F3 for the previous match
4

Close search

Press Esc to close the search prompt

Search and Replace

Replace text in the current buffer:
ShortcutAction
Ctrl+ROpen search and replace prompt
Ctrl+Alt+RInteractive query replace (y/n/!/q for each match)
1

Open replace

Press Ctrl+R to open the replace toolbar
2

Enter search and replacement

Type the search term, then Tab to the replacement field
3

Replace

Press Enter to replace the next match, or use “Replace All” to replace all occurrences

Search Options

The search toolbar includes toggle buttons for fine-tuning your search:

Case Sensitive

Match exact uppercase/lowercase. When disabled, foo matches Foo, FOO, and foo.

Whole Word

Match complete words only. When enabled, cat won’t match category or scat.

Regex

Use regular expressions for pattern matching. Enables powerful search patterns and capture groups.
Click the toggle buttons in the search toolbar, or use keyboard shortcuts to toggle them (shown in the toolbar).

Regular Expressions

Enable regex mode for powerful pattern matching:

Basic Regex Patterns

\bfunction\b
# Matches "function" as a complete word only

Capture Groups and Replacement

When regex mode is enabled, you can use capture groups in your replacement string:
Use $1, $2, etc. to reference captured groups:Search: (\w+): (\w+)
Replace: $2: $1
Result: name: valuevalue: name

Regex Examples

Search: function (\w+)\((\w+), (\w+)\)
Replace: function $1($3, $2)
Swaps the order of two function parameters.
Search: ([a-z])([A-Z])
Replace: $1_$2
Then convert to lowercase separately.
Search: \b(\w+)\b
Replace: "$1"
Wraps each word in double quotes.
Search: https?://([^/]+)/.*
Replace: $1
Extracts just the domain from full URLs.

Interactive Query Replace

For precise control over which matches to replace, use query replace:
1

Start query replace

Press Ctrl+Alt+R or use “Query Replace” from the command palette
2

Enter search and replacement

Type the search term and replacement text
3

Decide for each match

Fresh prompts for each match:
  • y — Replace this match
  • n — Skip this match
  • ! — Replace all remaining matches
  • q — Quit query replace
Query replace is perfect when you want to replace most occurrences but skip a few specific ones.

Find Selection

Quickly find the next occurrence of the currently selected text:
ShortcutAction
Alt+N or Ctrl+F3Find next occurrence of selection
Alt+P or Ctrl+Shift+F3Find previous occurrence of selection
1

Select text

Use mouse or keyboard to select a word or phrase
2

Find next

Press Alt+N or Ctrl+F3 to jump to the next occurrence
3

Create multi-cursor (optional)

Use Ctrl+D to add a cursor at the next match for multi-cursor editing
This is different from Ctrl+D which adds a cursor at the next match — find selection just moves the cursor without creating additional cursors.
Search across all files in your project using git grep:
1

Open project search

Open command palette (Ctrl+P) and search for “Search and Replace in Project”
2

Enter search term

Type the text or regex pattern to search for
3

View results

Fresh searches all git-tracked files and displays matches with file locations
4

Navigate to match

Click or select a result to jump to that location
Git Integration: Project search uses git grep and only searches files tracked by git. Untracked and ignored files are excluded.

Git Grep Features

Fresh’s project search leverages git grep for fast, efficient searching:

Fast

Git grep is highly optimized and can search large repositories quickly

Respects .gitignore

Automatically excludes files in .gitignore, node_modules, build artifacts, etc.

Regex Support

Use regular expressions for complex search patterns

Context Aware

Shows surrounding lines for context in search results

Search in Selection

Limit your search to just the selected text:
1

Select region

Use mouse or keyboard to select the text region you want to search within
2

Open search

Press Ctrl+F to open search
3

Search

Your search will be limited to the selected region
This is useful for searching within a specific function, class, or block of code without getting results from the entire file.

Search Tips and Tricks

Instead of replace all, use Ctrl+D (add cursor at next match) to create multiple cursors at each occurrence. This gives you visual feedback and more control — you can edit each occurrence differently if needed, and undo is a single operation.
Enable both “Whole Word” and “Regex” to match patterns at word boundaries only. For example, \d+ with whole word enabled matches standalone numbers but not digits within words.
Use Ctrl+F with regex mode first to verify your pattern matches what you expect. Then use Ctrl+R to replace.
When making potentially breaking changes (like renaming variables), use Ctrl+Alt+R (query replace) to review each match before replacing.
Use regex mode and search for ^$ to find empty lines. Replace with nothing to remove them.

Advanced Regex Patterns

function(?=\()
# Matches "function" only if followed by "("

Search Performance

Large Files: Fresh handles search efficiently even in multi-gigabyte files. Regex searches may be slower than literal string searches, but Fresh maintains low latency through incremental searching.
Project Search: Uses git grep which is highly optimized. First search may be slower as git indexes, but subsequent searches are very fast.

Multi-Cursor Editing

Use Ctrl+D to add cursors at matches

Editing Features

Learn about text manipulation

Command Palette

Access all search commands

Build docs developers (and LLMs) love