Back to tips
Insert Newlines in Search Bars with Ctrl-Enter
Add line breaks in search queries using keyboard shortcut on macOS
On macOS, you can now use Ctrl-Enter to insert newlines in search bars, making it easier to search for multi-line patterns.
How to Use
- Open buffer search (
Cmd-F) or project search (Cmd-Shift-F) - Type your search query
- Press
Ctrl-Enterto insert a newline - Continue typing on the next line
Enterstill executes the search as before
This keybinding is macOS-specific and matches common text editing patterns.
Why This Matters
Multi-line searches: Find patterns that span multiple lines.
Regex patterns: Format complex regular expressions for readability.
Code blocks: Search for code snippets with proper line breaks.
Natural workflow: Ctrl-Enter for newline, Enter for action.
Example Use Cases
- Searching for multi-line function signatures
- Finding code blocks with specific structure
- Locating formatted text patterns
- Building readable regex patterns with line breaks for clarity
Previously, there was no easy way to insert newlines in search bars - pressing Enter would execute the search. This enhancement brings better multi-line search support to Zed.