2025-10-23
hrn - plan file editor with a twist
hrn [OPTION] PATH
hrn is a plan file (to-do list) editor with support for linked files, for example for more detailed notes.
If PATH is a file, hrn will show/edit the contents of that file.
If PATH is a directory, hrn will recursively search for any .plan file in this directory and display them as a single tree. The tree will include nodes for directories where applicable, but those are not editable.
-d, --debug PATH
Write debug log to PATH.
-h, --help
Print help.
The following keys can be used to control hrn:
h, <Left>
Move selection to parent node.
j, <Down>
In list view, move selection to node in next line. In mind map view, move selection to next sibling node.
k, <Up>
In list view, move selection to node in previous line. In mind map view, move selection to previous sibling node.
l, <Right>
Expand current node if collapsed. Then move selection to first child (list view) or middle child (mind map view).
g, <Home>
Move selection to root node.
<Space>
Collapse or expand the selected node (toggles).
x
Expand the whole subtree of the currently selected node.
X
Expand all nodes.
c
Collapse the whole subtree of the currently selected node.
C
Collapse all nodes except the branch that contains the currently selected node.
A, <Tab>
Add new child node to end of currently selected node's children.
a
Add new child node to beginning of currently selected node's children.
i, <Enter>
Insert new sibling node after currently selected node.
I
Insert new sibling node before currently selected node.
d, <Delete>
Delete the currently selected node and all its children.
<Shift>+J
Move the currently selected node "down" (towards the end) amongst its siblings.
<Shift>+K
Move the currently selected node "up" (towards the beginning) amongst its siblings.
t
Toggle the selected node's icon.
e
Edit the selected node's caption.
E
Edit the selected node's linked file.
f
Display the selected node's linked file (see below).
F
Edit the selected node's linked file (see below).
v
Toggle the view mode between "list mode" (the default) and "mind map mode".
s
Toggle subtree view. If currently off, makes the currently selected node the view's root. If currently on, displays the entire loaded tree again.
w
Save all modifications to the tree by writing any changes to the respective files.
q
Quit. Will warn about unsaved changes if any.
<Shift>+Q
Force quit. Will discard any unsaved changes.
/
Search. Enter a search term and hit enter to highlight it in any node where it appears. Use /ESC to end search highlighting.
n
Go to next search match. If a search is currently active, go to the next matching node (if any).
N
Go to previous search match. Like n, but in the other direction.
<Ctrl>+c
Force quit (same as <Shift>+Q)
<Ctrl>+z
Stop and background hrn, subjecting it to the shell's job control, most commonly jobs and fg.
Linked files allow recording additional, unstructured information related to plan items, using tools of your choice.
To link an item with a file, edit its notes link (E) and enter that name of a file. The file itself need not exist, but any referenced directories do. The file name is relative to the plan file that the item is in, not the current working directory. Then use N to edit/create the notes file and n to show it. To remove a link, edit the link and set it to an empty string. Note that hrn will not delete the notes file itself.
When showing notes, hrn will invoke an external pager. It will first look for an environment variable HRNPAGER, then PAGER. If neither are set, it will default to less or more as fallback.
When editing notes, hrn will invoke an external editor. It will first look for an environment variable HRNEDITOR, then VISUAL, then EDITOR. If neither are set it will default to vim or nano as fallback.
This project is is maintained by Conrad Hoffmann <ch@bitfehler.net>. The source code can be found at https://git.sr.ht/~bitfehler/hrn. Bugs or patches can be submitted by email to ~bitfehler/public-inbox@lists.sr.ht.