> For the complete documentation index and Markdown links, see [llms.txt](/docs/preview/llms.txt).

# Project Panel

The project panel shows a tree view of your workspace's files and directories.
Toggle it with <code class="hljs">project panel: toggle focus</code> (<kbd class="keybinding">cmd-shift-e&#124;ctrl-shift-e</kbd>), or click the **Project Panel** button in the
status bar.

![Project Panel](https://images.zed.dev/docs/project-panel/panel.png)

## Navigating

Use the arrow keys to move through entries. <kbd class="keybinding">right&#124;right</kbd> expands a directory and <kbd class="keybinding">left&#124;left</kbd> collapses it. <kbd class="keybinding">cmd-left&#124;ctrl-left</kbd> collapses every directory at once. <kbd class="keybinding">cmd-right&#124;ctrl-right</kbd> expands every directory at once. Press <kbd class="keybinding">space&#124;space</kbd> or click to preview a selected file, without giving it a
permanent tab. Editing the file or double-clicking it promotes it to a permanent tab.
Middle-clicking a file skips the preview and opens it in a permanent, focused tab
right away.

### Auto-reveal

By default, switching to a file in the editor will automatically highlight it in the
project panel and scroll it into view. This can be disabled with the
`project_panel.auto_reveal_entries` setting.

### Sticky Scroll

When `project_panel.sticky_scroll` is enabled (the default), ancestor directories pin themselves to the top
of the panel as you scroll, so you always know which directory you're on.

![Project Panel: Sticky Scroll Enabled](https://images.zed.dev/docs/project-panel/sticky-scroll-true.png)

![Project Panel: Sticky Scroll Disabled](https://images.zed.dev/docs/project-panel/sticky-scroll-false.png)

### Directory Folding

When `project_panel.auto_fold_dirs` is enabled (the default), chains of directories that each contain a
single child directory are collapsed into one row (for example,
`src/utils/helpers` instead of three separate levels). Right-click a folded
directory and choose **Unfold Directory** to expand the chain, or **Fold
Directory** to collapse it again.

![Project Panel: Auto Fold Directories Enabled](https://images.zed.dev/docs/project-panel/auto-fold-dirs-true.png)

![Project Panel: Auto Fold Directories Disabled](https://images.zed.dev/docs/project-panel/auto-fold-dirs-false.png)

## Selecting Multiple Entries

Hold `shift` while pressing the up/down arrow keys to mark additional entries.
Most file operations, like cut, copy, trash, delete and drag, apply to the full
set of marked entries.

When exactly two files are marked, <code class="hljs">project panel: compare marked files</code>
(<kbd class="keybinding">alt-d&#124;alt-d</kbd>) opens a diff view comparing them.

![Project Panel: Compare Marked Files](https://images.zed.dev/docs/project-panel/compare-marked-files.png)

## File Operations

Right-click an entry to see the full list of available operations, or use the
keybindings below.

### Creating Files and Directories

- <code class="hljs">project panel: new file</code> (<kbd class="keybinding">cmd-n&#124;ctrl-n</kbd>) creates a new
  file inside the selected directory.
- <code class="hljs">project panel: new directory</code> (<kbd class="keybinding">alt-cmd-n&#124;alt-ctrl-n</kbd>)
  creates a new directory.

An inline editor appears so you can type the name. Press `enter` to
confirm or `escape` to cancel.

### Renaming

Press <kbd class="keybinding">f2&#124;f2</kbd> to rename the selected entry. The filename
stem is pre-selected so you can type a new name without accidentally changing
the extension. Press `enter` to confirm or `escape` to
cancel.

### Cut, Copy, and Paste

- <code class="hljs">project panel: cut</code> (<kbd class="keybinding">cmd-x&#124;ctrl-x</kbd>) marks entries for
  moving.
- <code class="hljs">project panel: copy</code> (<kbd class="keybinding">cmd-c&#124;ctrl-c</kbd>) marks entries for
  copying.
- <code class="hljs">project panel: paste</code> (<kbd class="keybinding">cmd-v&#124;ctrl-v</kbd>) places them in the
  selected directory.

When pasting would create a name conflict, Zed appends a "copy" suffix (e.g.,
`file copy.txt`, `file copy 2.txt`). If a single file is pasted with a generated
suffix, the rename editor opens automatically so you can adjust the name.

### Duplicate

<code class="hljs">project panel: duplicate</code> (<kbd class="keybinding">cmd-d&#124;</kbd>) copies and
pastes the selected entries in one step.

### Trash and Delete

- <code class="hljs">project panel: trash</code> (<kbd class="keybinding">cmd-backspace&#124;delete</kbd>) moves entries to
  the system trash.
- <code class="hljs">project panel: delete</code> (<kbd class="keybinding">cmd-alt-backspace&#124;ctrl-delete</kbd>) permanently
  deletes entries.

Both actions show a confirmation prompt listing the affected files. If any of
the files have unsaved changes, the prompt warns you.

### Drag and Drop

Drag entries within the panel to move them. Hold `alt` while dropping to copy
instead of move. You can also drag files from your operating system's file
manager into the project panel to copy them into the project. Drag and drop can
be disabled with the `project_panel.drag_and_drop` setting.

## Git Integration

When `project_panel.git_status` is enabled (the default), file and directory names are tinted
to reflect their git status—modified, added, deleted, untracked, or conflicting.

Setting `project_panel.git_status_indicator` to `true` (disabled by default) adds a letter badge next
to each name: **M** (modified), **A** (added), **D** (deleted), **U**
(untracked) or **!** (conflict).

![Project Panel: Git Integration](https://images.zed.dev/docs/project-panel/git-status.png)

Use <code class="hljs">project panel: select next git entry</code> and <code class="hljs">project panel: select prev git entry</code> to jump between tracked files with
uncommitted changes. The right-click menu also offers **Restore File** to
discard changes and **View File History** to browse a file's commit log.

## Diagnostics

The `project_panel.show_diagnostics` setting controls whether error and warning
indicators appear on file and folder icons. Set it to `"all"` to see both errors
and warnings, `"errors"` for errors only, or `"off"` to hide them. Diagnostics
propagate upward—if a file deep in a directory has an error, its ancestor
folders show an indicator too.

Enable `project_panel.diagnostic_badges` (disabled by default) to display numeric error and warning
counts next to each entry. Use <code class="hljs">project panel: select next diagnostic</code> and
<code class="hljs">project panel: select prev diagnostic</code> to navigate between files that
have diagnostics.

See also [Diagnostics & Quick Fixes](./diagnostics.md) for editor and tab diagnostic settings.

## Filtering and Sorting

### Hiding Files

- `project_panel.hide_gitignore` hides files matched by `.gitignore`. Toggle
  this with <code class="hljs">project panel: toggle hide git ignore</code>.
- `project_panel.hide_hidden` hides dotfiles and other hidden entries. Toggle
  with <code class="hljs">project panel: toggle hide hidden</code>.

### Sorting

The `project_panel.sort_mode` setting controls grouping:

- `"directories_first"` (default) — directories appear before files at each
  level.
- `"files_first"` — files appear before directories.
- `"mixed"` — directories and files are sorted together.

The `project_panel.sort_order` setting controls name comparison:

- `"default"` — case-insensitive natural sort (`file2` before `file10`).
- `"upper"` — uppercase names grouped first, then lowercase.
- `"lower"` — lowercase names grouped first, then uppercase.
- `"unicode"` — raw Unicode codepoint order with no case folding.

## Other Actions

- <code class="hljs">project panel: reveal in file manager</code> (<kbd class="keybinding">alt-cmd-r&#124;alt-ctrl-r</kbd>) reveals the selected entry in Finder /
  File Explorer.
- <code class="hljs">project panel: new search in directory</code> (<kbd class="keybinding">cmd-alt-shift-f&#124;ctrl-alt-shift-f</kbd>) opens a project search scoped to the
  selected directory.
- <code class="hljs">project panel: remove from project</code> removes a workspace root folder
  from the project.

## Undo and Redo

The Project Panel keeps a history of the file operations you perform through it,
letting you undo (<code class="hljs">project panel: undo</code> / <kbd class="keybinding">cmd-z&#124;ctrl-z</kbd>) and
redo (<code class="hljs">project panel: redo</code> / <kbd class="keybinding">cmd-shift-z&#124;ctrl-shift-z</kbd>) these
operations, with support for local and remote projects.

The following operations are tracked:

- <code class="hljs">project panel: new file</code>
- <code class="hljs">project panel: new directory</code>
- <code class="hljs">project panel: rename</code>
- <code class="hljs">project panel: trash</code>
- <code class="hljs">project panel: paste</code>
- <code class="hljs">project panel: duplicate</code>

Besides these actions, moving items within the panel using drag and drop, as
well as dragging files into the panel from outside Zed, are also tracked.

Undoing a move or rename (for example <code class="hljs">project panel: rename</code>, a
<code class="hljs">project panel: cut</code> followed by paste, or a drag within the panel)
returns the item to its original name or location.

Undoing an operation that creates a file or directory (for example
<code class="hljs">project panel: new file</code>, <code class="hljs">project panel: new directory</code>,
<code class="hljs">project panel: duplicate</code>, a <code class="hljs">project panel: copy</code> followed by
paste, or a drag from outside Zed) moves the new item to your system trash
rather than deleting it. This keeps it recoverable and lets redo restore it, but
it also means you may notice these items appear in your trash.

When you batch several of these together, for example, selecting multiple files
and moving them to another folder, the whole batch is undone or redone as a
single step, and a failure in one of the operations does not block the rest.

### Limitations

- Undo and redo are not available when collaborating in a project shared by
  someone else. The same applies to <code class="hljs">project panel: trash</code>, so when
  working as a guest in a shared project, files can only be permanently
  deleted, and file operations cannot be undone.
- Operations whose result is a path excluded from the project via the
  `file_scan_exclusions` setting are not recorded. For example, with
  `**/*.secret` excluded, creating a file named `token.secret`, or renaming an
  existing file to `token.secret`, succeeds on disk, but the operation cannot
  be undone from the panel.
- Permanently deleting an item (<code class="hljs">project panel: delete</code>) is not tracked
  and cannot be undone.
- Undoing a <code class="hljs">project panel: trash</code> restores the item from your system's
  trash. If you empty the trash, the item can no longer be restored.
- Undo and redo act on the current state of the filesystem. If something changed
  outside Zed, for example, a conflicting file now exists at the destination, or
  the item was moved or deleted by another program, the operation may no longer
  be undoable, and Zed will show a notification accordingly.
- On remote hosts without system trash support, <code class="hljs">project panel: trash</code>
  will fail when used, along with anything that relies on it, such as undoing a
  trash or undoing an operation that creates a file or directory. At the time of
  writing, Zed does not reliably detect trash support ahead of time, so the
  action is always available but may report an error.
- The undo history is not persisted across sessions, so quitting Zed clears it.
