Skip to content

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.

  • 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:

ItemWhat it does
Rename… (F2)Renames it.
DuplicateMakes a copy next to it.
Copy Path, Copy Relative PathCopies its full path, or its path inside the project.
Copy File ContentCopies the file’s text.
Reveal in FinderShows it in Finder.
Open in TerminalOpens a terminal in that folder, or in the file’s folder.
DeleteMoves it to the macOS Trash.
Delete PermanentlyDeletes 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.

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.
  1. In the editor, select the code you want to change.
  2. Press ⌘I to open Inline Edit.
  3. 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.

Some files open as a preview instead of in the editor:

FileOpens as
MarkdownA rendered page, including Mermaid diagrams. Hercus can’t edit Markdown files; ask an agent to change them.
Images and PDFsThe image or document.
CSV and TSVA table.
Other binary filesA message that there’s no preview.

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.
  • 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.