Quick Search
The fastest way to search in the current buffer:| Shortcut | Action |
|---|---|
Ctrl+F | Open search prompt |
F3 | Find next match |
Shift+F3 | Find previous match |
Esc | Close search prompt |
Search and Replace
Replace text in the current buffer:| Shortcut | Action |
|---|---|
Ctrl+R | Open search and replace prompt |
Ctrl+Alt+R | Interactive query replace (y/n/!/q for each match) |
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.
Regular Expressions
Enable regex mode for powerful pattern matching:Basic Regex Patterns
Capture Groups and Replacement
When regex mode is enabled, you can use capture groups in your replacement string:- Numbered Groups
- Named Groups
Use
Replace:
Result:
$1, $2, etc. to reference captured groups:Search: (\w+): (\w+)Replace:
$2: $1Result:
name: value → value: nameRegex Examples
Swap function parameters
Swap function parameters
Search:
Replace:
function (\w+)\((\w+), (\w+)\)Replace:
function $1($3, $2)Swaps the order of two function parameters.Convert camelCase to snake_case
Convert camelCase to snake_case
Search:
Replace:
([a-z])([A-Z])Replace:
$1_$2Then convert to lowercase separately.Add quotes around words
Add quotes around words
Search:
Replace:
\b(\w+)\bReplace:
"$1"Wraps each word in double quotes.Extract domain from URLs
Extract domain from URLs
Search:
Replace:
https?://([^/]+)/.*Replace:
$1Extracts just the domain from full URLs.Interactive Query Replace
For precise control over which matches to replace, use query replace:Find Selection
Quickly find the next occurrence of the currently selected text:| Shortcut | Action |
|---|---|
Alt+N or Ctrl+F3 | Find next occurrence of selection |
Alt+P or Ctrl+Shift+F3 | Find previous occurrence of selection |
This is different from
Ctrl+D which adds a cursor at the next match — find selection just moves the cursor without creating additional cursors.Project-Wide Search
Search across all files in your project using git grep: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:Search Tips and Tricks
Use multi-cursor with find next
Use multi-cursor with find next
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.Combine whole word with regex
Combine whole word with regex
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.Test regex before replacing
Test regex before replacing
Use
Ctrl+F with regex mode first to verify your pattern matches what you expect. Then use Ctrl+R to replace.Use query replace for risky changes
Use query replace for risky changes
When making potentially breaking changes (like renaming variables), use
Ctrl+Alt+R (query replace) to review each match before replacing.Search for empty lines
Search for empty lines
Use regex mode and search for
^$ to find empty lines. Replace with nothing to remove them.Advanced Regex Patterns
Search Performance
Project Search: Uses git grep which is highly optimized. First search may be slower as git indexes, but subsequent searches are very fast.
Related Documentation
Multi-Cursor Editing
Use Ctrl+D to add cursors at matches
Editing Features
Learn about text manipulation
Command Palette
Access all search commands