# Files and search

> Browse the file tree, open files by name and search across the project.

## Files

<Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>E</Kbd> opens Files in the right dock and moves focus to it. Press it again to return to the center. The tree reveals the active tab's file as you switch tabs.

### What the tree shows

- **Always hidden:** `.git`, `target`, `node_modules` and `.DS_Store`.
- **Ignored files** are hidden by default. <Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>.</Kbd> shows them, muted. Nested `.gitignore` files apply.
- **Git status letters** (`M`, `A`, `D`, `R`, `U`) mark changed files. Folders show the strongest status inside them.
- **Changes from outside Rexa,** by agents or git, appear on their own.

### Open files

- **Click** opens a temporary tab that the next click replaces. **Double-click** keeps it.
- <Kbd>Space</Kbd> previews the file and keeps the keyboard in the tree.
- <Kbd>⌘</Kbd> <Kbd>↓</Kbd> opens a kept tab and moves focus to it.

### Keyboard

| Action                          | Shortcut                                       |
| ------------------------------- | ---------------------------------------------- |
| Move                            | <Kbd>↑</Kbd> <Kbd>↓</Kbd>                      |
| Expand / collapse               | <Kbd>→</Kbd> / <Kbd>←</Kbd>                    |
| Collapse all                    | <Kbd>⌘</Kbd> <Kbd>←</Kbd>                      |
| Next / previous changed file    | <Kbd>⌥</Kbd> <Kbd>↓</Kbd> / <Kbd>⌥</Kbd> <Kbd>↑</Kbd> |
| New file / new folder           | <Kbd>A</Kbd> / <Kbd>⇧</Kbd> <Kbd>A</Kbd>       |
| Rename                          | <Kbd>↵</Kbd>                                   |
| Delete                          | <Kbd>⌫</Kbd>                                   |
| Cut / copy / paste              | <Kbd>⌘</Kbd> <Kbd>X</Kbd> / <Kbd>⌘</Kbd> <Kbd>C</Kbd> / <Kbd>⌘</Kbd> <Kbd>V</Kbd> |
| Copy path / relative path       | <Kbd>⌘</Kbd> <Kbd>⌥</Kbd> <Kbd>⇧</Kbd> <Kbd>C</Kbd> / <Kbd>⌘</Kbd> <Kbd>⌥</Kbd> <Kbd>C</Kbd> |
| Undo last create, rename or move | <Kbd>⌘</Kbd> <Kbd>Z</Kbd>                     |
| Back to the center              | <Kbd>Esc</Kbd>                                 |

With [Vim mode](/docs/customize/vim) on, <Kbd>H</Kbd> <Kbd>J</Kbd> <Kbd>K</Kbd> <Kbd>L</Kbd> move, `]c` and `[c` jump between changed files, and <Kbd>⇧</Kbd> <Kbd>R</Kbd> / <Kbd>⇧</Kbd> <Kbd>D</Kbd> rename and delete.

<Kbd>⌘</Kbd>-click marks several rows; <Kbd>⇧</Kbd> <Kbd>↑</Kbd> and <Kbd>⇧</Kbd> <Kbd>↓</Kbd> extend the marked range.

### Create, rename, move and delete

- **Names can contain `/`.** `src/new/file.ts` creates the folders on the way; a trailing `/` makes a folder.
- **Renaming the folder part moves the item.** Open tabs follow the rename.
- **Drag onto a folder** to move into it; hold <Kbd>⌥</Kbd> to copy. Drag onto a terminal to insert the paths.
- **Delete asks first** and moves items to the macOS Trash.
- **Pasting over an existing name** creates `name 2`.

Rename, move and delete are refused while a tab under that path has unsaved edits. Moving files between worktrees is not supported.

### Settings

<FieldGroup>
  <Field name="files.respect_gitignore" type="boolean" default="true">Hide ignored files.</Field>
  <Field name="files.git_status" type="boolean" default="true">Show git status letters.</Field>
  <Field name="files.auto_fold" type="boolean" default="true">Fold chains of single-child folders into one row.</Field>
  <Field name="files.indent_guides" type="boolean" default="true">Draw indent guides.</Field>
  <Field name="files.sticky_headers" type="boolean" default="false">Pin parent folders while scrolling.</Field>
  <Field name="files.search_nested_worktrees" type="boolean" default="false">Include worktrees nested inside this one in quick open.</Field>
</FieldGroup>

## Quick open

<Kbd>⌘</Kbd> <Kbd>P</Kbd> opens the palette in files mode. Type part of a path; results are fuzzy-matched and capped at 100.

- **Jump to a line** with `path:line` or `path:line:col`.
- **Switch modes** by typing a prefix: `>` for commands, `@` for sessions, `~` for worktrees. See [Interface](/docs/workspace/interface).

Quick open follows the same ignore rules as the tree.

## Find in a file

<Kbd>⌘</Kbd> <Kbd>F</Kbd> opens the find bar in an editor or a markdown preview.

| Action                     | Shortcut                                            |
| -------------------------- | --------------------------------------------------- |
| Next / previous match      | <Kbd>⌘</Kbd> <Kbd>G</Kbd> / <Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>G</Kbd> |
| Match case                 | <Kbd>⌘</Kbd> <Kbd>⌥</Kbd> <Kbd>C</Kbd>              |
| Whole word                 | <Kbd>⌘</Kbd> <Kbd>⌥</Kbd> <Kbd>W</Kbd>              |
| Regular expression         | <Kbd>⌘</Kbd> <Kbd>⌥</Kbd> <Kbd>R</Kbd>              |
| Search in selection        | <Kbd>⌥</Kbd> <Kbd>L</Kbd>                           |
| Toggle replace (editor)    | <Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>H</Kbd>              |

## Project search

<Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>F</Kbd> opens Search in the right dock. With a single-line selection in the focused tab, that text fills the query and the search runs at once.

- **Results stream** as you type, grouped by file. Click a match to open the file at that line.
- **Toggles:** match case, whole word, regular expression.
- **Include and exclude** globs sit behind the `…` button, comma-separated, such as `*.ts, src/**/*.rs`.
- **Replace** with the replace toggle: one line, one file, or Replace all. Writes go to disk; open tabs without unsaved edits reload.

Search respects `.gitignore`, skips binary files and files over 8 MB, and stops at 10,000 matches.
