Search
Development reference · View source
Search has two flavours and one behavior:
| Key | Flavour |
|---|---|
s | Literal 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-darkandember-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 action | Effect |
|---|---|
| An edit straight away | Changes every match |
n / N | Selects only the next / previous match; further presses cycle that single selection through the remembered results |
An edit after n / N | Changes only the match you reached |
A selection motion such as e | Turns 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:
x x xselects three lines.sfinds the calls in them./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.
| Want | Write | Not |
|---|---|---|
| Case-insensitive | (?i)hello | /hello/i |
| Case-sensitive | Hello (the default) | |
| Scoped flag | (?i:hello) World | |
| Across lines | (?s)foo.*bar or foo\nbar |
| Inline flag | Meaning |
|---|---|
i | Case-insensitive |
m | ^ and $ match at line boundaries |
s | . also matches newline |
R | CRLF-aware multiline boundaries |
U | Swap greedy and lazy repetition |
u | Unicode (on by default) |
x | Verbose 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.
| Key | Action |
|---|---|
s | Search the buffer, ignoring case |
/ | Search the buffer with a regular expression |
n / N | Select only the next / previous match |
* | Select every occurrence of the word or selection under the caret |
f | Find the next typed character in the buffer |
Space / s | Search the workspace, ignoring case |
Space / / | Search the workspace with a regular expression |
Space f or Space / f | Open the Finder over files, buffers, and terminals by name or content; Tab switches modes and Ctrl-t toggles preview |
Space / a | The same Finder over every file, ignore files not consulted |
Space / p | The same unfiltered Finder rooted at a typed path, inside the workspace or outside it |
Tab f in a directory | The same Finder rooted at the directory the explorer shows (:open-explorer-finder) |
Space s c | Keep only the primary selection in any multi-selection |
Space s e / Space s b | Put 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 r | Keep / 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
.
Workspace search
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, andtargetare skipped by name, and symlinks are skipped.editor.show_hidden_filesapplies.- 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.