Files and editor
Browse your workspace's files, edit them, preview documents, and review changes hunk by hunk.
The Files panel shows your workspace’s folder. Files you open appear in the editor beside it. Files is the first panel a new workspace shows; to open it, show the sidebar (⌘B) and select Files.
Browse files
Section titled “Browse files”- Select Search Files to find a file by name.
- To add a file or folder, select New File… or New Folder….
- Drag files and folders to move them.
Right-click a file or folder for more:
| Item | What it does |
|---|---|
| Rename… (F2) | Renames it. |
| Duplicate | Makes a copy next to it. |
| Copy Path, Copy Relative Path | Copies its full path, or its path inside the project. |
| Copy File Content | Copies the file’s text. |
| Reveal in Finder | Shows it in Finder. |
| Open in Terminal | Opens a terminal in that folder, or in the file’s folder. |
| Delete | Moves it to the macOS Trash. |
| Delete Permanently | Deletes it for good, after you confirm. This can’t be undone. |
The panel header shows WORKSPACE while you’re looking at the workspace’s folder. To see the project’s main folder instead, select Show Project Files next to it. This matters in a workspace with its own branch, where the two folders differ. The Git, PRs, and CI panels have the same switch.
Edit files
Section titled “Edit files”Select a file to open it in the editor. Each workspace keeps its own tabs. You can also open a file from the Command Palette (⌘P) by typing part of its name.
- Hercus saves your changes about a second after you stop typing. Press ⌘S to save right away. If a save fails, select Retry save.
- When an agent changes a file you have open, the editor reloads it, unless you have unsaved changes.
- Right-click a tab for Close Other Tabs, Close Tabs to the Right, and Close All Tabs.
Ask an agent to change code
Section titled “Ask an agent to change code”- In the editor, select the code you want to change.
- Press ⌘I to open Inline Edit.
- Describe the change, for example “Add error handling”, and press Enter.
An agent rewrites the selected code in place. Press ⌘Z to undo it. To stop while it’s working, select Abort. Press Esc to close the box.
Previews
Section titled “Previews”Some files open as a preview instead of in the editor:
| File | Opens as |
|---|---|
| Markdown | A rendered page, including Mermaid diagrams. Hercus can’t edit Markdown files; ask an agent to change them. |
| Images and PDFs | The image or document. |
| CSV and TSV | A table. |
| Other binary files | A message that there’s no preview. |
Review changes in a diff
Section titled “Review changes in a diff”When you select a changed file in the Git panel, its diff opens in the editor area:
- Inline view and Side-by-side view switch the layout.
- Previous change and Next change jump between changes.
- On each change, Stage hunk, Unstage hunk, and Discard hunk act on just that part of the file, so you can keep some of a file’s changes and drop the rest.
Open files from Finder
Section titled “Open files from Finder”- Drag a file onto the Hercus window to open it.
- Drag a folder onto the window to add it as a project, or to switch to it if it’s already one.