Using archr
Finding your way
The tree, the view, and a small set of keys that mean the same thing everywhere.
archr has a tree on the left and a view on the right, the same in a review or not. The view shows what the tree's cursor is on, so the cursor keys alone are enough to scan a project. In a review archr opens with the keys in the view.
The tree
The tree is the project's folders and files, with folders opening in place. In a git repository it is what git sees: tracked files, untracked ones it does not ignore, and files a review deleted. There it follows files as they are made, changed and deleted.
- A folder holding nothing but one folder shares its row with it, as
internal/serve/, so a deep path costs one row. - In each folder the files come first, then the folders.
- What is in the project's own folder is not indented, indentation stops growing past a few levels, and long names are cut from the left so the file name stays.
.shows or hides the files git ignores. They can be read, but not marked reviewed or noted.- In a review,
fshows only the files the review changed, or everything. thides the tree while the keys are in the view, and shows it again;←out of the view shows it too. Thetreesetting starts with it hidden.
Rows carry markers in columns at the right: replies waiting for you ↩, comments ●, annotations ◆.
Each counts what is on the row and inside it.
The glyph is hollow, ○ or ◇, when none of it is on the row itself.
A row with no markers gives their room to its name.
In a review a column at the left of the name says what the review changed and what is reviewed.
The view
The view follows the tree's cursor as it moves.
- A file is shown whole, opening at its first change in a review.
- A folder is shown as every change under it in one scroll, so related changes read together. The root is the whole review.
- Annotations and comments are drawn under what they are on, so reading them takes no extra step.
eopens the file in$EDITORat the current line.
One job per key
| Job | Keys |
|---|---|
| Move within a pane | hjkl, arrows |
| One level in, one out | → ← |
| Back through jumps | ctrl+o |
| The main action | Enter |
| What is said about it | i |
→ and ← move one level in and out, the levels being a closed folder, an open one, then the view.
→ opens a closed folder, and on an open one or a file moves into the view.
← closes an open folder, and on a closed one or a file goes up to the folder it is in.
In the view, → goes onto the line's tokens and ← back to the whole line, then out to the tree.
Going between the tree and the view keeps both places: the tree its cursor, the view its file and line.
Enter in the tree shows the file or folder in the view and moves there. In the view it opens a fold, or else goes to the next change.
The mouse
- A click in the tree moves its cursor there, and a click on the folder the cursor is on opens or closes it.
- A click in the view moves the cursor to that line.
- A drag in the view selects lines, as
Vdoes, foryto copy oraandcto write on. - The wheel scrolls what it is over: the view by half a page, the tree by three rows.
archr takes the mouse, so the terminal's own selection needs whatever key the terminal gives for that, often Shift.
Jumps and going back
A jump is a bracket key, a search, gg, G, or following an id or a reference.
Plain movement is not a jump.
ctrl+o goes back from a jump.
Jumps in a row within one file are kept as one, the place last left, so going back is short.
There is no going forward.
Bracket keys
Bracket keys move through things and go round from the last to the first.
From the tree they go into the view, as / and n do.
| Keys | Moves through |
|---|---|
]h [h |
Changes |
]f [f |
Changed files |
]a [a |
Annotations |
]c [c |
Comments |
]t [t |
Tour stops |
The status bar shows where you are among them, as change 2/5 or file 3/10, until you move some other way.
A ↻ after it says the move went round.
n and N repeat the bracket key used last, forward and back.
After ], [ or g a panel above the status bar lists the keys that can follow and what each does.
Backspace goes from it to every key for what is on screen, which ? shows too, and Esc closes it.
Files are stepped through in the tree's order: a folder's files first, then its folders.
Searching
/searches the file, or every file in a folder's changes.nandNgo to the next and previous match.g/searches the project.grfinds the uses of the name under the cursor.
A search ignores case unless it has a capital in it. What a project search finds is listed along the bottom to step through, in the tree's order, as a tour is.
In the view
→←move through a line's tokens, andVselects lines.ycopies the line, the token or the selected lines.spacemarks a place, in the tree or the view, for one note on several places at once.swraps long lines onto up to ten rows, or cuts them.- The cursor's line wraps onto as many rows as the view has, when that is more than ten.
{}move by paragraph,ctrl+dctrl+uby half a screen, andctrl+fctrl+bby a whole one.:and a number, then enter, goes to that line.
Tabs are drawn to tab stops four cells apart.
Any other control character, in a file, its name, a commit message or a note, is drawn as its picture, such as ␛ for escape or ␍ for a carriage return that does not end a line.