Files and the in-app editor
Browse your worktree's files in the sidebar and make quick edits without leaving Tegment.
The Files tab in the right sidebar shows a file tree for the worktree you have selected, and clicking a file opens it in a built-in editor. It is for the quick edits that would otherwise mean a trip to your IDE: fix a typo in a config, tweak a value an agent got wrong, read a file the agent just wrote.
For anything bigger, Open in IDE is still there. The in-app editor complements your IDE rather than replacing it.
The file tree#
The right sidebar has two tabs: Changes (the file changes view) and Files. Tegment remembers which one you had open.
The tree is rooted at the active worktree and follows your selection, so switching worktrees switches the tree.
- Expanded folders, loaded listings, and your selection are kept per worktree, so clicking around terminals and conversations and coming back leaves the tree exactly as you left it.
node_modulesand.gitare hidden.- The tree is a full ARIA tree, so arrow keys expand, collapse, and move through it, and Enter opens the selected file.
Git status in the tree
Files carry their status against the last commit, so you can see what an agent touched without switching to Changes:
| Mark | Meaning |
|---|---|
Green name, A | Added. |
Green name, U | Untracked. |
Amber name, M | Modified. |
Amber name, R | Renamed. |
A folder carries a dot when anything inside it has changed, however deep, so a change is visible while the folder is still collapsed.
Right-click actions
Right-click a row for Open, Rename, Delete, New file, New folder, Refresh, Copy relative path, Copy absolute path, and Reveal in file manager. Right-clicking the empty space below the tree targets the worktree root, which is where you create a top-level file or folder.
Deleting moves the entry to your operating system's trash, so it stays recoverable. Tegment refuses to rename or delete the worktree root itself, anything inside .git or node_modules, and anything that is a symlink.
Refresh re-reads the folder you clicked it on, or the whole tree from the empty space. The tree keeps up with changes on its own; refresh is there for when you want to be sure.
The editor#
A file opens as a full panel in the center of the app, the same way settings do, so it gets the whole area instead of a cramped modal.
- Save with Ctrl+S. A dot on the header marks unsaved changes, and Reset throws them away and reloads from disk.
- If something else changes the file while you have it open (an agent, a
git checkout, your IDE), a banner offers Reload or Keep editing. Saving over a file that changed underneath you asks first. - Word wrap toggles in the header, and your choice sticks for the next file you open.
- Binary files and very large files show a short explanation and an Open in IDE action instead of loading.
The editor belongs to the repository you opened it from. Switching repositories hides it with your unsaved changes intact, and coming back brings it up again.
Find and replace
Ctrl+F opens a search panel in the top-right of the editor. It counts as you type ("3 of 6"), and toggles inside the field switch on regular expressions, case sensitivity and whole-word matching.
- Enter and F3 jump to the next match, Shift+Enter and Shift+F3 to the previous.
- The replace row is folded behind the chevron until you need it, with Replace and Replace all.
- Esc closes the panel and puts the cursor back in the file.
A file you can only read is still searchable; the replace row simply stays out of the way.
Marks for what you have changed
A gutter beside the line numbers shows how each line compares to the last commit:
| Mark | Meaning |
|---|---|
| Green bar | The line is new. |
| Blue bar | The line was rewritten. |
| Red triangle | Lines were removed here. |
While you have unsaved changes, the marks follow their lines as you type above and below them. Lines you have just typed stay unmarked until you save, because the comparison is against what is on disk.
Opening a file from elsewhere#
Right-click any file in the Changes tab and choose Open in editor, next to Open in your IDE. It works for staged and unstaged entries alike. Deleted files and binary files are greyed out, since there is nothing to edit.
The diff viewer offers the same: a pencil on each file's header opens it, and right-clicking a file row gives you the actions that apply there. Under History the editor is deliberately absent, since it would open the file as it stands on disk rather than the version in that commit.
However you open a file, the Files tree follows it: the tree expands to the file, selects it and scrolls it into view, so you can see where it sits. It never switches tabs on you, so opening from Changes leaves you on Changes with the tree ready for when you go there.
What Tegment allows itself#
The editor reads and writes only inside the worktree you are looking at. Paths are resolved against the real folder on disk, so a .. or a symlink pointing outside it is refused rather than followed, and Tegment never writes through a symlink. See what Tegment changes on your machine for the full picture.