1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
# 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 j j
# plus body-normal Esc run Last, the hop to the pane you were in BEFORE this
# one, whichever kind it was. It reads the focus history the core already keeps
# to hand focus back when a pane closes, and going somewhere is itself recorded,
# which is what makes the hop back 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
# its clicks and goldens were laid out by the pardes placement rule
config Placement pardes
start 31 100 w.txt
wait 8000 Newcol Joincol
wait 8000 w.txt
stable 700 20000
# A FILE boots alone now, so the terminal every hop below needs is opened here:
# Alt-n opens it and focuses it, Alt-c puts it in a column of its own on the
# right, SPC w h comes straight back — which also puts the shell on the stack,
# and Last only ever names a pane that is on it. (`New`/`Newcol` open an empty
# +New scratch now, not a shell.)
key a-n
key a-c
stable 700 15000
key space w h
stable 400 5000
# left column = the file, right column = that shell; the file has focus
snap start
# SPC j j: the pane before this one, which is the shell just opened
key space j j
stable 400 5000
snap to-term
# ...and back, because going there made the file the pane before THAT
key space j j
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 j j from a terminal: the file, which is where SPC w h left off
key space j j
stable 400 5000
snap toggle-doc
# ...and back to the shell just left, not the launch shell in the right column,
# which was focused earlier
key space j j
stable 400 5000
snap toggle-back
|