zed-industries/zed
Search
Active contributors: SomeoneToIgnore, yara-blue
Purpose
Project-wide find and replace, fuzzy file finder, command palette, recent-projects picker, and other "pickers" (the modal UIs you summon via Cmd-K / Cmd-P / Cmd-Shift-F).
Crates
| Crate | Role |
|---|---|
crates/search |
Project-wide find/replace UI + view |
crates/file_finder |
Cmd-P fuzzy file picker |
crates/picker |
Reusable picker primitive used by many features |
crates/command_palette |
The Cmd-Shift-P palette |
crates/command_palette_hooks |
Hooks crates use to contribute palette entries |
crates/recent_projects |
Recent / known projects picker (Cmd-Shift-O) |
crates/tab_switcher |
Cmd-` tab switcher |
crates/fuzzy, crates/fuzzy_nucleo |
Two fuzzy-matching backends |
crates/project::search |
The cross-file search engine |
crates/multi_buffer |
Renders search results as an aggregated buffer |
How it works
graph TD
User[User Cmd-Shift-F] --> S[Search view]
S --> P[project::search]
P -->|spawn ripgrep-style scan| Worktrees[Worktrees]
Worktrees -->|matches| P
P --> MB[MultiBuffer]
MB --> Editor[Editor view of MultiBuffer]
User -->|edit in MB| MB
MB -->|writes back| BuffersProject-wide search
project::search walks open worktrees, applies include/exclude globs, and matches via regex or literal. Matches stream into a MultiBuffer so they render incrementally.
Replace is performed by editing the MultiBuffer; edits propagate back to underlying buffers, which write to disk on save.
Fuzzy matching
Two fuzzy backends are present:
crates/fuzzy— the original.crates/fuzzy_nucleo— anucleo-based replacement.
Pickers consume whichever backend their settings point at.
Picker
crates/picker is the reusable list-with-fuzzy-input primitive. File finder, command palette, recent projects, language selector, theme selector, and many more all sit on it.
Command palette
command_palette enumerates registered actions across crates. Crates contribute via command_palette_hooks so the palette doesn't have to know about every action statically.
Entry points for modification
- New picker — wrap
crates/pickerwith a fresh delegate. - New search filter —
crates/search/src/.... - New scoring / matching —
crates/fuzzy_nucleo. - New palette entry — register through
command_palette_hooksin the crate that owns the action.
Related pages
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.