Back to tips

Insert Newlines in Search Bars with Ctrl-Enter

Add line breaks in search queries using keyboard shortcut on macOS

shortcuts beginner March 16, 2026 · godruoyi
#search #keybindings #multiline #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

  1. Open buffer search (Cmd-F) or project search (Cmd-Shift-F)
  2. Type your search query
  3. Press Ctrl-Enter to insert a newline
  4. Continue typing on the next line
  5. Enter still 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.