// The pardes cheatsheet: the facts only, an index into the docs, not a copy. // cheatsheet-a4.typ lays it out; style.typ says how each element looks. // config.zig's "docs/typ" test checks every #word, #key and #tag here // against the registry, the keymap and the default tags. #import "style.typ": key, keys, btn, chord, word, tag, addr, file, cmd, doc, pairs == The mouse #pairs( btn("B1"), [select, and focus the pane. On a tag: type there.], btn("B2"), [*execute* the word or selection: a builtin, else a shell line.], btn("B3"), [*look*: open the file, address, directory or URL, else find the word's next place. Resting the pointer tints what B3 would take.], [sweep], [drag B2 or B3 to run or look at exactly what you swept.], [grip], [drag the box left of a tag: up/down resizes, onto another column moves the pane. A column's right edge drags its width.], ) === Chords: hold the first, click the next #pairs( chord("B1", "B2"), [cut the B1 selection], chord("B1", "B3"), [paste over it], chord("B1", "B2", "B3"), [copy: cut, then paste back, B1 still down], chord("B2", "B1"), [execute the word with the B1 selection as argument (#word("Grep") on a selected name)], chord("B2", "B3"), [cancel the sweep (#chord("B3", "B2") too)], ) Over a program that takes the mouse, Shift swaps: #btn("B1", shift: true) selects, #btn("B2", shift: true) goes to the program. == Tags #tag("Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config Debug Exit") #tag("New Tty Find Grep Joincol Delcol") #tag("Save Tty Collapse Del", path: "/home/me/notes.txt") #tag("Tty+bash Save Mode Filter Collapse Del", path: "/home/me/src") #tag("Tty PdfSections PdfTint Collapse Del", path: "manual.pdf [1/12]") - #word("Del") over unsaved text refuses once; again discards. `Del j`: rows below. - #word("Undo") #word("Redo") #word("Edit") #word("Mode") work typed anywhere. #doc("tags") == Look addresses Typed anywhere, then #btn("B3") or #key("Enter"): #pairs( addr("file:12"), [line 12], addr("file:12:5"), [line 12, byte column 5], addr("file:/re/"), [next match after the selection (`file:0/re/`: first)], addr(":40"), [the pane looked from, line 40 (`:40:5`, any address after `:`)], addr("~/x"), [home; also in `Save`, `Restore`, `pardes ~/x`], addr("@p3:12"), [pane 3 by serial, a terminal's lines too], addr("src/"), [a directory: `ls` in an idle terminal there, else a new one], ) Addresses are sam's: `#n`, `/re/`, `?re?`, `$`, `a,b`. #doc("fs", section: "look-and-exec") == Keys: normal mode Helix-style: motions *select*, then an edit acts on the selection. Mode box: blank normal, `^` insert, `$` raw terminal. #pairs( [#keys("h", "j", "k", "l") #keys("w", "b", "e")], [move; words select], [#keys("g g", "g e")], [first line, last line], [#keys("g h", "g l", "^")], [line start, end, first non-blank], [#keys("x", "v", "%")], [line, character select, all], [#key(";")], [collapse to the cursor], [#keys("d", "c", "y")], [delete, change, yank], [#keys("p", "P", "R")], [paste after, before, replace], [#keys("u", "U")], [undo, redo], [#keys("i", "a", "I", "A", "o", "O")], [insert; #key("Esc") back to normal], [#keys("s", "S")], [regex: a cursor per match, split], [#keys("C", ",")], [cursor on next line; keep primary], [#keys("/", "n", "N")], [search, next, previous], [#keys("m i", "m m")], [textobject, matching bracket], [#key("|")], [pipe each selection through the shell], [#keys("g d", "g r")], [definition, references (language server)], [#keys("Ctrl-d", "Ctrl-u")], [half page down, up], [#keys("Enter", "Tab")], [look, execute the selection (like #btn("B3"), #btn("B2"))], [#key(":")], [to the pane's tag and back], ) #doc("keys") == Keys: panes #pairs( [#key("Ctrl-w") #keys("h", "j", "k", "l")], [then a direction: focus a neighbour (not in insert or raw `$`)], [#key("Esc")], [back to the previous pane (raw: only at a prompt with nothing typed; insert: to normal)], [#key("Shift-Esc")], [back to the previous pane from any mode, with the kitty keyboard protocol or in the GUI; elsewhere a plain Esc], [#keys("Ctrl-o", "Ctrl-i")], [jump history back, forward], [#key("Alt-n")], [new terminal below], [#key("Alt-c")], [move the pane to a new column], ) == The leader: #key("SPC") in normal mode #pairs(split: 2, key("SPC ?"), [every path], key("SPC f s"), word("Save"), key("SPC f n"), word("New"), key("SPC f f"), word("Find"), key("SPC f g"), word("Grep"), key("SPC f r"), word("Recent"), key("SPC f c"), word("Config"), key("SPC d"), word("Del"), key("SPC n t"), word("Tty"), key("SPC n 9"), word("Tty9p"), key("SPC w h"), [focus left], key("SPC j j"), word("Last"), key("SPC j l"), word("Jumplist"), key("SPC y"), [clip yank], key("SPC p"), [clip paste], key("SPC t t"), word("Themes"), key("SPC t n"), word("NextColor"), key("SPC t w"), word("Wrap"), key("SPC c n"), word("Newcol"), key("SPC c p"), word("Placement"), key("SPC s d"), word("Dump"), key("SPC s r"), word("Restore"), key("SPC s a"), word("Attach"), key("SPC s D"), word("Detach"), key("SPC h t"), word("Tutor"), key("SPC h m"), word("Messages"), key("SPC q"), word("Exit"), ) == Terminals and commands - #key("Ctrl-b"): raw (`$`) or normal. #word("Mode") cycles raw, normal, insert. #word("Filter"), #word("Tty+bash"). - #btn("B2") on a non-builtin line runs it in a *command pane*: #tag("Kill Save Collapse Del", path: "/home/me/src (make) exit 0") - #word("Kill") `make` stops it; #word("Exit") quits. `Repl python`: `.py` clicks go to it. == Reviewing diffs `git diff` output is a diff: #btn("B3") on a file line, an `@@` or a line's `+`/`-` jumps there. #doc("tags", section: "reviewing-diffs") == Finding things - #word("Find") `name`, #word("Grep") `text` (literal): a `+Search` listing. #word("Recent"): files lately. #word("Help"), #word("Tutor"). == Sessions `pardes --detach=work`; `--attach=work` or #word("Attach") `work`; #word("Detach") leaves it running. #doc("detached") == Config #word("Config") (#key("SPC f c")): `~/.config/pardes/init`, a builtin a line (`Theme atelier`). #word("DumpConfig"): every setting. #word("Dump") / #word("Restore"): the workspace. #doc("config") == Themes #word("Themes") lists them; #word("Theme") `name`; #word("NextColor"); #word("ThemeFile") `x.zon`. #doc("themes") == The virtual filesystem (9P) Pane shells get `$PARDES_9P` (the socket) and `$PARDES_PANE` (their own pane); a command clicked in a pane also gets `$winid`, the pane it was clicked in. #cmd("9ns --mntgen # then m=$PARDES_MOUNT in every pane") #cmd("9p -a \"unix!$PARDES_9P\" read index") #pairs( file("index"), [a line per pane: serial, kind, name], file("look exec"), [write a line: a #btn("B3") or #btn("B2")], file("log"), [events; write `follow` to wait], file("pane/new"), [open to make a pane], file("pane/N/addr"), [an address; `data` reads/replaces it], file("pane/N/ctl"), [builtins: `Save`, `Edit ...`], file("pane/N/body tag"), [its text (`>>` appends)], ) #cmd("echo notes.txt:12 > $m/pane/$n/look") #cmd("echo /foo/ > $m/pane/$n/addr; printf bar > $m/pane/$n/data") #cmd("echo 'Edit ,x/foo/c/bar/' > $m/pane/$n/ctl") #cmd("exec 3<>$m/log; echo follow >&3; cat <&3") `pardes FILE` opens it here; `EDITOR='pardes --wait'`. #doc("fs")