Files
helder/docs/guide/explorer.md
T

145 lines
6.4 KiB
Markdown

# Explorer
The Explorer is the project's file tree. It is the second column from the left, between the [Git](git.md) column and the [File view](file-view.md).
[Guide index](index.md) · Related: [Right-click menu](right-click-menu.md), [Dialogs](dialogs.md), [Git](git.md), [File view](file-view.md), [Layout](layout.md)
## At a glance
```text
+-------------------------------------+
| (1) EXPLORER console |
|-------------------------------------|
| (2)v [] app |
| v [] Http |
| (3) > [] Controllers |
| (4) [php] Kernel.php (5)M|
| > [] config |
| > [] tests |
| [md] README.md |
| [json] composer.json A |
| |
| (6) |
+-------------------------------------+
```
1. **Header**: the word `Explorer` on the left, the project name on the right.
2. **Open folder**: an amber `v` chevron and an open folder icon.
3. **Closed folder**: a grey `>` chevron and a closed folder icon.
4. **File**: a file-type badge and the file name, indented under its folder.
5. **Status letter**: the git status of a changed file.
6. **Empty space** under the rows: stands for the project folder itself. Right-click it for the project menu.
## Features
### Expand and collapse folders
- Click a folder to expand it. Click it again to collapse it.
- Each click also re-reads that folder from disk, so files the agent just added show up.
- A project opens with every folder collapsed.
- Opening a file from anywhere (the [Git](git.md) view, [Go to file](go-to-file.md), [Search](search.md)) expands its folders and highlights it in the tree.
- Folders come first, then files, each sorted by name. Case does not matter in the sort.
### Icons
- Folders show a folder icon, open or closed, and a chevron.
- Files show a small file-type badge, for example `php`, `md` or `json`. The [Git](git.md) column and the [File view](file-view.md) bar use the same badges.
- An open folder shows its name in bright text.
### Status letters
A file with a git change shows a letter on the right of its row:
| Letter | Meaning | Colour |
|---|---|---|
| `A` | Added (new or untracked) | teal |
| `M` | Modified | teal |
| `R` | Renamed | teal |
| `D` | Deleted | amber-deep |
| `U` | Merge conflict | red |
The letter is the file's overall status. When a file has both a staged and an unstaged change, the unstaged one wins. Folders do not show a letter.
### Selection
One row is highlighted. That is:
- the file open in the [File view](file-view.md), or
- the row under the keyboard cursor, while the Explorer is the active column, or
- the row whose [right-click menu](right-click-menu.md) is open.
Hovering a row moves the keyboard cursor to it. Hover a file to see its full project-relative path in a tooltip.
### Open a file
- Click a file to open it in the [File view](file-view.md).
- When the open file has unsaved edits, Helder asks first: Save, Don't Save or Cancel. See [Dialogs](dialogs.md#unsaved-changes).
### Keyboard navigation
- Click the Explorer, or move focus to it with `Cmd+Left` / `Cmd+Right`, to make it the active column.
- `Up` and `Down` move the cursor through the visible rows.
- `Enter` on a file opens it. `Enter` on a folder expands or collapses it.
- `Cmd+Right` opens the [right-click menu](right-click-menu.md#explorer-file) of the row under the cursor, beside the column.
### What the tree leaves out
- **Hidden files**: names that start with a dot (`.env`, `.github`) are hidden. Press `Cmd+.` or click **Hidden** in the [Title bar](title-bar.md) to show them. The choice holds for the whole window.
- **Build and tool folders**: these never show: `node_modules`, `vendor`, `.git`, `out`, `dist`, `build`, `.cache`, `coverage`, `.helder`, `.next`, `.nuxt`, `.turbo`, `.idea`, `.vscode`, and `.DS_Store` files.
- **Your own excludes**: glob patterns in `files.exclude` hide matching paths.
- **Git-ignored files**: shown by default, so files like `.env` stay reachable. Set `files.followGitignore` to `true` to hide them.
- **Symbolic links** are not shown.
The same rules apply to [Search](search.md) and [Go to file](go-to-file.md).
### Create, rename and delete
All file actions start from the [right-click menu](right-click-menu.md):
- **New file** and **New folder**: right-click a folder. **New file** in the project root: right-click the empty space under the rows.
- **Rename file** and **Rename folder**: right-click the entry.
- **Delete file** and **Delete folder**: right-click the entry. Delete always asks first, and it deletes for good. It does not use the Trash.
New file, New folder and Rename open a small [name prompt](dialogs.md#name-prompt). Delete opens a [confirm dialog](dialogs.md#delete-file-or-folder).
After the action:
- A new file opens in the [File view](file-view.md). Its folders expand.
- A new folder expands, ready for its first file.
- A renamed file stays open under its new name. Expanded folders stay expanded.
- A deleted file closes in the File view.
- A [notification](notifications.md) confirms each action, or says why it failed.
### Stay up to date
The tree follows the disk. Helder watches the project folder and reloads the tree after a short pause when files change. `Cmd+R` reloads it by hand, together with git and the open file.
## Keyboard
| Keys | Action |
|---|---|
| `Up` / `Down` | Move the row cursor (Explorer active) |
| `Enter` | Open the file, or expand or collapse the folder |
| `Cmd+Right` | Open the right-click menu of the row under the cursor |
| `Cmd+Left` / `Cmd+Right` | Move focus to the column on the left or right |
| `Cmd+.` | Show or hide hidden files |
| `Cmd+R` | Reload the tree, git and the open file |
## Settings
All settings live in `.helder/config.json`. See [Configuration](configuration.md).
| Setting | Default | Effect |
|---|---|---|
| `files.exclude` | `[]` | Glob patterns to hide from the tree and the search |
| `files.followGitignore` | `false` | `true` hides files that git ignores |
## Related
- [Right-click menu](right-click-menu.md): every action on a file, a folder and the empty space.
- [Dialogs](dialogs.md): the name prompt and the delete confirmation.
- [Git](git.md): the same status letters, with staging.
- [File view](file-view.md): where a clicked file opens.
- [Layout](layout.md): the Explorer toggle, Hidden and column widths.
- [Go to file](go-to-file.md): open a file by name without the tree.