User guide / Key bindings

Search

Development reference · View source

Search has two flavours and one behavior:

KeyFlavour
sLiteral text, ignoring case. The pattern is escaped, so foo( and a.b find themselves. No wildcards.
/A regular expression, matching case unless the pattern says otherwise. Use it for wildcards or case-sensitive search.

There is no separate case-sensitive literal key: use /, escaping any regex syntax, when case matters, and (?i) in a / pattern to ignore case.

How a search selects

Every search selects all its matches at once, so the next edit applies to all of them.

  • Each match is selected in full, with the cursor on its last character, where an append or a motion continues from.
  • The primary match has the primary-selection ground and one cursor in the Select colour (pink in ember-dark and ember-light, orange in most other built-in themes). Other matches keep the secondary selection colour without cursors.
  • The status line shows the primary’s position among the results.

Then:

Next actionEffect
An edit straight awayChanges every match
n / NSelects only the next / previous match; further presses cycle that single selection through the remembered results
An edit after n / NChanges only the match you reached
A selection motion such as eTurns the results into ordinary selections, with their Select-coloured endpoint cursors, and shows the selection count

Preview while typing

  • Every match the pattern would select is highlighted as Enter would leave it.
  • The pane scrolls to the match that would become primary: the first at or after the cursor.
  • Nothing is selected until Enter. Escape returns the pane to where it was.
  • A pattern matching nothing highlights nothing and returns the view.
  • An unfinished regular expression such as foo( keeps the last preview until it is valid again.
  • The rest of the pane stays dimmed under the prompt.

Searching inside a selection

When at least two characters are selected — from v and a motion, x, %, or a previous search — the search looks only inside that text, and n/N wrap within it.

Searches therefore narrow step by step:

  1. x x x selects three lines.
  2. s finds the calls in them.
  3. / picks out one argument.

Press ; to collapse to a caret and search the whole buffer again.

Regular expressions

/ passes the pattern directly to Rust’s regex engine. The / key opens the prompt; it is not a delimiter in a JavaScript-style /pattern/flags.

WantWriteNot
Case-insensitive(?i)hello/hello/i
Case-sensitiveHello (the default)
Scoped flag(?i:hello) World
Across lines(?s)foo.*bar or foo\nbar
Inline flagMeaning
iCase-insensitive
m^ and $ match at line boundaries
s. also matches newline
RCRLF-aware multiline boundaries
USwap greedy and lazy repetition
uUnicode (on by default)
xVerbose mode
  • Supported: character classes, alternation, groups, greedy and lazy repetition, anchors, word boundaries, Unicode properties, \d, \s, \w.
  • Not supported: slash-delimited expressions, trailing flags, look-around, backreferences.
  • Capturing groups compile, but only the complete match is selected.
  • Buffer search runs over the whole text, so a pattern can span lines. Workspace regex search is line-scoped, because each result names one row, so Space / / cannot return a multiline match.

:help regex has more examples and a compact syntax table.

Search keys

s and / search this buffer. Space / widens the same two to the whole project: Space / s mirrors s and Space / / mirrors /. The Finder is f rather than a sigil — Space f, its namespace spelling Space / f, and Space g f over commits — and Space / a and Space / p open that Finder over a wider scope. Space s holds selection commands only.

KeyAction
sSearch the buffer, ignoring case
/Search the buffer with a regular expression
n / NSelect only the next / previous match
*Select every occurrence of the word or selection under the caret
fFind the next typed character in the buffer
Space / sSearch the workspace, ignoring case
Space / /Search the workspace with a regular expression
Space f or Space / fOpen the Finder over files, buffers, and terminals by name or content; Tab switches modes and Ctrl-t toggles preview
Space / aThe same Finder over every file, ignore files not consulted
Space / pThe same unfiltered Finder rooted at a typed path, inside the workspace or outside it
Tab f in a directoryThe same Finder rooted at the directory the explorer shows (:open-explorer-finder)
Space s cKeep only the primary selection in any multi-selection
Space s e / Space s bPut a cursor at the end / start of every selected line
Space s a or &Pad with spaces until every cursor shares the rightmost display column
Space s k / Space s rKeep / remove selections matching a typed regular expression

The directory-scoped pickers have no key: :file-picker-directory and :fuzzy-grep-directory search below the active file or explorer directory. The Finder is described under The Finder .

Space / s and Space / / search every file in the project.

What is searched:

  • No ignore file is consulted: a gitignored path the Finder omits is still searched.
  • .git, .runyte, and target are skipped by name, and symlinks are skipped.
  • editor.show_hidden_files applies.
  • Files larger than 4 MiB are not read.

While it runs:

  • Accepting the prompt queues the walk in the background and returns to input. The result buffer opens when it completes.
  • A newer workspace search supersedes an older one, so a late result cannot replace a newer query.
  • The status row is temporarily replaced by Searching workspace, the query, the elapsed time, and a rotating - \ | / spinner.

The result buffer is one read-only [workspace search] buffer, replaced by each new search.

  • Rows are path:line:column, a snapshot taken at query time.
  • Enter opens the result under the cursor. Movement, selection, copying, s, /, splits, help, buffer switching, and jump history work as usual.
  • Visit as many results as you like without rerunning the query; rerun it to refresh.

This differs from the Finder’s content mode, whose fuzzy query stays live and so remains a choose-one picker.