# RULE: moving focus is a BUILTIN like any other, so there is ONE # implementation and every route reaches it. SPC w h/j/k/l run Left/Down/Up/ # Right — the geometric focusDir the Ctrl-w prefix also runs — and SPC w t # plus body-normal Esc run Toggleterm, the hop between the most recently # focused DOCUMENT (a file, an image, a +Search/+Help output buffer: things # you READ) and the most # recently focused TERMINAL. "Most recent" is the focus history the core # already keeps to hand focus back when a pane closes, so the hop back is the # same key. Focus shows up in the golden's `cursor=` header: that is the # ACTIVE pane's cursor, so each snap is named by the pane it should land in. file w.txt alpha\nbeta\ngamma start 30 100 w.txt wait 8000 New Newcol wait 8000 w.txt stable 700 20000 # left column = the file, right column = the launch shell; the file has focus snap start # SPC w t with a shell that has NEVER been focused: nothing to find in the # history, so it falls back to a scan and still lands in the right column key space w t stable 400 5000 snap to-term # ...and back, because the file is now the latest document key space w t stable 400 5000 snap back-to-file # A bare Esc from a body in normal mode dispatches that SAME builtin: file to # terminal, then the same key on the normal-mode terminal returns to the file. key esc settle 100 stable 400 5000 snap esc-to-term key esc settle 100 stable 400 5000 snap esc-back-to-file # Alt-n: a second shell, below the file — the left column now has two rows key a-n stable 700 15000 snap altn # SPC w k: up out of that new shell into the file above it key space w k stable 400 5000 snap up # SPC w l: right, into the launch shell key space w l stable 400 5000 snap right # SPC w h: left, back into the file column key space w h stable 400 5000 snap left # SPC w j: down, into the shell under the file key space w j stable 400 5000 snap down # SPC w t from a terminal: the file, which is the only document here key space w t stable 400 5000 snap toggle-doc # ...and back to the LATEST terminal — the one just left, not the launch shell # in the right column, which was focused earlier key space w t stable 400 5000 snap toggle-back