Apps

Find

# Find — Project Search Two search modes in one panel, selected with the Text / Files tabs (or `Ctrl+PgUp` / `Ctrl+PgDn`): - Text searches file contents with ripgrep (or the configured grep backend) and lists `file:line: matching text`. `Enter` on a result opens the file in the editor at the matching line. - Files searches file and directory names and lists the matching paths. Queries are case-insensitive substring matches by default; add glob wildcards to match names or paths. `Enter` on a file opens it; `Enter` on a directory makes it the search root and runs the same query again inside it. Both tabs share the same root directory. The Dir field is a normal editable text input: type a path and press `Enter` to commit it (`.` or an empty value restores the current working directory). Committing a new root clears the current results. The root is always inside the project (the host's working directory). Absolute paths inside the project are normalized to project-relative paths; paths outside it (`/tmp`, `../../..`) are rejected with an error. Directory results only ever point inside the project. ## Text tab The header fields are standard editable text inputs, cycle with `Tab`: - Find: the search query. `Enter` runs the search (or opens the highlighted result when the query is unchanged). - Dir: the search root (shared with the Files tab). - In: the file glob, e.g. `*.dft`, `*.md`, `*`. - Regex: click the checkbox to treat the query as a regular expression instead of a literal string; the keyboard shortcut is `Ctrl+R` (this reruns the current query). ## Files tab - Name: the name/path query. `Enter` searches; pressing `Enter` again opens the highlighted result. - Dir: the search root (shared with the Text tab). Entering a directory result moves the root there, so repeated `Enter` presses walk down the tree. ### Globbing A query with `*` or `?` is treated as a glob (case-insensitive). `*` matches within one path segment, `**` crosses `/`, and `?` matches one character. - Patterns without `/` match the basename anywhere under the root: `*.dft` finds every `.dft` file, `find?` matches `find.dft`/`find.md`, `test_*` finds `test_foo.dft` and `src/test_bar.dft`. - Patterns with `/` match the root-relative path: `src/*.dft` matches direct children of `src/`, `**/*.dft` matches recursively, and `packages/**/test_*.dft` matches named test files anywhere below `packages/`. - A bare name without wildcards is still a case-insensitive substring match over the root-relative path (e.g. `find` or `stdext/src`). Name search prunes `.git`, `.zig-cache`, `zig-cache`, `zig-out`, `node_modules`, `target` and `.cache`, and caps the list at the first 2000 matches. ## Key Bindings | Key | Action | |-----|--------| | `Enter` | Query field: execute search / open selected result. Dir field: commit the typed root. On a directory result: re-root and search inside it | | `Tab` / `Shift+Tab` | Cycle the editable fields in the active tab | | `Ctrl+PgUp` / `Ctrl+PgDn` | Switch between the Text and Files tabs | | `Ctrl+R` | Toggle literal/regex mode (Text tab; reruns the query) | | `Left` / `Right` / `Home` / `End` | Move the cursor inside the focused field | | `Ctrl+Left` / `Ctrl+Right` | Move by word | | `Backspace` / `Delete` | Delete a character (`Ctrl+Backspace` / `Ctrl+Delete`: a word) | | `Up` / `Down` | Move through results | | `Page Up` / `Page Down` | Fast-scroll results (10 rows) | | `Home` / `End` | Jump to the first/last result | | `Escape` | Clear the active tab's query and results; focus its query field | | (any text input) | Edit the focused field | Click a result to select it. The tab headers are clickable as well. `set-query-and-search` (rpc) remains the entry point used by the editor and help panels; it switches to the Text tab. `set-name-query-and-search` runs a file-name query in the Files tab.