Open-Source Wikis

/

Zed

/

Features

/

Search

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| Buffers

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 — a nucleo-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/picker with a fresh delegate.
  • New search filter — crates/search/src/....
  • New scoring / matching — crates/fuzzy_nucleo.
  • New palette entry — register through command_palette_hooks in the crate that owns the action.
  • EditorMultiBuffer is the rendering target
  • Project — search is rooted on Project

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Search – Zed wiki | Factory