User guide / Files and buffers

Directory tree sidebar

Development reference · View source

The directory tree is a sidebar at the left of the editor area. It is not a pane or a buffer.

KeyAction
Space d tShow or hide the tree
Space d dShow and focus it, expand the active file’s ancestors, and select the file
Ctrl-w h / Ctrl-w lMove focus across the tree boundary (Ctrl-h / Ctrl-l with editor.fast_pane_keys)
EscapeReturn to the previous pane, keeping the tree shown
  • Space d d refreshes those listings, so files created or moved outside the editor can be revealed. A file outside the workspace, or a buffer with no file, selects the workspace-root row.
  • The [dir tree] title sits above the root row. The tree stays rooted at the workspace root when :cd changes the working directory.
  • Expansion, selection, scroll position, legend visibility, and a resized width survive hiding it.
  • Fullscreen and zen cover it temporarily. Terminals narrower than 36 columns hide it.

Moving in the tree

KeyAction
j / k, Down / UpNext / previous row
Home / End, gg / ge or GFirst / last row
PageUp / PageDown, Ctrl-b / Ctrl-fPage up / down
Ctrl-u / Ctrl-dHalf a page
gt / gc / gb, H / M / LTop / middle / bottom visible row
l or RightExpand a directory, or select its first child
h or LeftCollapse a directory, or select its parent
Enter on a directoryToggle expansion
Space rRefresh the selected directory
ClickSelect a row and focus the tree
Double-clickAct as Enter: toggle a directory or open a file
WheelMove the selection three rows

Digits choose destination panes (below), not counts. A double-click is two left presses on the same row within half a second; a third press starts a new pair rather than toggling the directory straight back.

Tree actions

KeyAction
.Show or hide dotfiles in the tree.
/Search visible entry names with a regular expression.
gwLabel onscreen entries; type a label to select its entry without opening it.
Ctrl-n / Ctrl-pSelect the next/previous tree search match, wrapping.
nCreate a file; end its relative path with / to create a directory.
dDelete the selected entry after Delete <path>? [y/N] in the interaction line.
mMove to a typed path; Tab completes paths in this prompt.
rRename the selected entry.
vOpen the selected file in a vertical split.
sOpen the selected file in a horizontal split.
EnterOpen the selected file in an existing pane.
1–9Open the selected file directly in that numbered pane.
TabToggle the dimmed key legend below the horizontal rule.

Choosing a pane. With one pane, Enter, v, and s act at once. With several:

  1. Pane titles are replaced by numbers from 1, top to bottom and left to right. The tree is not numbered.
  2. Type a digit to open in that pane, or split it. With more than nine panes, type a longer number; Enter accepts a number that is also a prefix of another.
  3. Escape cancels and restores the titles.

Numbers are recalculated for each request.

Changing files. Create, move, and rename apply as soon as the prompt is submitted; Escape cancels the prompt, and there is no review stage. Delete needs y; Enter, n, or Escape cancels. Deletion goes to the trash first. Every operation rechecks filesystem identities and destination collisions, refuses to overwrite, and updates affected open buffers. The safety and non-atomicity limits of Applying changes apply.

Jump labels replace the markers before names: one key for nearby entries, two for farther ones. Only rows visible above the legend are labelled. Escape or an unmatched key cancels and keeps tree focus.

The legend is shown by default and wraps to the tree width: n: new, d: delete, m: move, r: rename, v: open in v-split, s: open in h-split, Tab: legend, .: hidden files, /: search. Remapped keys show their live spellings.

Hidden files. The tree starts with editor.show_hidden_files. The . override belongs to this workspace’s tree and survives hiding it.

  • Hiding a selected dotfile, or a hidden ancestor, selects the nearest visible ancestor.
  • Revealing a file explicitly can still show a hidden path; toggling visibility clears that exception.

Tree search. / opens tree search (regex):.

  • Enter selects the next matching visible name. Matching ignores case unless the pattern uses (?-i).
  • Collapsed directories are not searched.
  • An empty prompt repeats the previous search, and Escape cancels without moving.
  • Ctrl-n / Ctrl-p repeat it; n keeps its create action.
  • Tree searches do not affect buffer searches.

Quitting from the tree. While the tree is focused, :q, :wc, and :close (and their long and ! forms) hide it and return focus to the previous pane, keeping buffers, panes, and terminal sessions. :qa quits the workspace as usual.

Width

The preferred width is editor.directory_tree_width: 33 columns by default, 12 to 240 allowed. Change it in Space o o or the configuration file.

ToDo
Resize for this workspaceDrag the tree’s right border
Widen / narrow by 5 from the tree:resize-right + 5 / :resize-right - 5
Widen the adjacent pane by narrowing the tree:resize-left + 5 from that pane

Other edges behave as for ordinary panes. The tree always leaves at least 24 columns for the pane layout.

Refreshing the tree

  • Listings load in the background only as directories are expanded.
  • Directory symlinks are shown as links and never expanded recursively.
  • While the tree is shown, expanded directories are checked every two seconds. Entries created, renamed, moved, or deleted outside Runyte appear automatically.
  • The selected path stays selected while it exists; otherwise the nearest visible ancestor is selected.
  • Collapsed branches and a hidden sidebar are not scanned. Expanding a branch refreshes it, and showing the sidebar resumes checking.