# The Grep builtin (topbar word, `SPC f g`): `grep -R`, in-core. It arms the # SAME tag input `/` and Find use, but the walk reads file CONTENTS under every # pane's directory at once — minus any directory another pane's already # contains, so a tree two panes sit in is searched ONCE and every hit appears # once. A row is `path:LINE:COL-ENDCOL text` — the match's whole span, so # looking it SELECTS the hit — with the path RELATIVE to the directory # of the pane that asked — the same directory its results buffer is named in, # so the short name resolves; only a hit from outside that tree stays absolute. # n/N walk the rows like any other result list, and a row pointing into a file # nothing has open yet opens it. dirmk sub file a.txt hello TARGET one\nnothing here\nlast TARGET line file sub/b.txt deep\nTARGET inside sub file noise.txt nothing to see start 30 180 -n 3 wait 8000 a.txt stable 700 20000 # open a.txt: a SECOND pane, whose directory the shell's cwd already covers — # its root is dropped, which is what keeps the hits below un-duplicated press left 5 8 release left 5 8 stable 400 5000 key i text a.txt key esc settle 100 stable 400 5000 press right 6 8 release right 6 8 wait 10000 hello TARGET stable 700 15000 snap opened # middle-click Grep on the topbar (row 1, the word's own column): the input # arms on the ACTIVE pane's tag, exactly where `/` would have typed press middle 17 1 release middle 17 1 stable 400 5000 text TARGET stable 400 5000 snap typing # Enter walks: two hits in a.txt, one in sub/b.txt, sorted by path — and the # file that holds none of them contributes no row key enter wait 10000 sub/b.txt:2:1 stable 700 15000 snap results # n looks the first row: absolute path, line 1, columns 7..12 (`TARGET`), and # those six cells come up selected key n stable 700 15000 snap first # ...and stepping on into sub/b.txt opens the file nothing had open key n stable 700 15000 key n wait 10000 TARGET inside sub stable 700 15000 snap opened-hit # a pattern nothing holds: an empty list of its own, n has nowhere to go. # Armed from the LEADER, not the topbar word: the n above left the hit # SELECTED in a.txt (a ranged result row is one a look selects), and a topbar # execute chords whatever is selected into its argument — so a middle-click # here would run `Grep TARGET` and never ask for a pattern at all. The leader # path runs the builtin with no argument, which is what this step is about; the # chord itself is the last two snaps below. key space key f key g stable 400 5000 text zzqq key enter stable 700 10000 key n stable 400 5000 snap nomatch # the acme chord: a builtin executed with a SELECTION held takes it as the # argument, so dragging over `TARGET` in a.txt and then clicking Grep runs the # walk on that word at once — no tag input, nothing typed. TARGET already has # a list open from above, so this refills THAT one; only the zzqq list below is # a second buffer, because only it is a different search. press left 14 3 drag left 20 3 release left 20 3 stable 400 5000 snap chordsel press middle 17 1 release middle 17 1 wait 10000 sub/b.txt:2:1 stable 700 15000 snap chord