summaryrefslogtreecommitdiff
path: root/docs/typ/cheatsheet.typ
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-30 22:33:15 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commit989dcf395be7280240fc501ba1f07f75bacf91a3 (patch)
treed0d5c9901621b13f3bb4520140835ee0dec30ac3 /docs/typ/cheatsheet.typ
parent71c715e10fe85d71b615c8f9a5a2b0c4c95b1a3f (diff)
downloadpardes-989dcf395be7280240fc501ba1f07f75bacf91a3.tar.gz
pardes-989dcf395be7280240fc501ba1f07f75bacf91a3.zip
The cheatsheet draws mouse buttons as a mouse, keys as chips, and pairs as tables
#btn and #chord draw a mouse (left button, wheel, right button) with the pressed part filled; the wheel is a narrow slot on a paper halo, hollow or filled, so it never reads as a button. A chord is the held button, then for each click the held one and that one down, with arrows between; #btn(.., shift: true) adds a ⇧. HTML gets a span with an aria-label. A key is one soft pill with no border: a combination (Ctrl-w) reads Ctrl + w and a sequence (g g, SPC f c) g › g, separators muted inside it; #keys("h", "j", ...) sets alternatives as separate pills. The drift test reads every key a #keys call names. #pairs sets key | meaning content as a two-column table on alternating tints; split: 2 sets the leader map as two such tables side by side. The mouse chords get their own table: cut, paste, copy (B1-B2 then B1-B3, one B1 hold, as mouse.zig says), 2-1 with an argument, 2-3 cancelling. The A4 page draws its own title and drops the content's level-1 heading. docs/typ/README is the function contract for content files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'docs/typ/cheatsheet.typ')
-rw-r--r--docs/typ/cheatsheet.typ110
1 files changed, 65 insertions, 45 deletions
diff --git a/docs/typ/cheatsheet.typ b/docs/typ/cheatsheet.typ
index 5069614a..5abd970f 100644
--- a/docs/typ/cheatsheet.typ
+++ b/docs/typ/cheatsheet.typ
@@ -2,18 +2,25 @@
// 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, btn, chord, word, tag, addr, file, cmd, doc
+#import "style.typ": key, keys, btn, chord, word, tag, addr, file, cmd, doc, pairs
== The mouse
-/ #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.
-/ #chord("B1", "B2"): cut; #chord("B1", "B3") paste; both: copy.
-/ #chord("B2", "B1"): execute the word with the B1 selection as argument (#word("Grep") on a selected name).
-/ #chord("B2", "B3"): cancel the sweep (either way round).
-/ 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.
-A program that takes the mouse (htop, vim `mouse=a`) gets #btn("B1") and the wheel; #btn("B2")#btn("B3") stay pardes's. Hold Shift to swap: Shift-#btn("B1") selects, Shift-#btn("B2") goes to the program.
+#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)],
+)
+A program that takes the mouse (htop, vim `mouse=a`) gets #btn("B1") and the wheel; #btn("B2")#btn("B3") stay pardes's. Hold Shift to swap: #btn("B1", shift: true) selects, #btn("B2", shift: true) goes to the program.
== Tags
Three levels of command text, every word live: the workspace tag, a tag per column, a tag per pane (file, terminal, PDF).
@@ -32,7 +39,7 @@ Three levels of command text, every word live: the workspace tag, a tag per colu
== Look addresses
Typed anywhere, then #btn("B3") or #key("Enter"):
-#table(columns: 2,
+#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)],
@@ -45,53 +52,66 @@ Addresses are sam's: `#n`, `/re/`, `?re?`, `$`, `a,b`. #doc("fs", section: "look
== Keys: normal mode
Helix-style: motions *select*, then an edit acts on the selection. Mode box: blank normal, `^` insert, `$` raw terminal.
-#table(columns: 2,
- [#key("h j k l") #key("w b e")], [move; words select],
- [#key("g g") #key("g e")], [first line, last line],
- [#key("g h") #key("g l") #key("^")], [line start, end, first non-blank],
- [#key("x") #key("v") #key("%")], [line, character select, all],
+#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],
- [#key("d") #key("c") #key("y")], [delete, change, yank],
- [#key("p") #key("P") #key("R")], [paste after, before, replace],
- [#key("u") #key("U")], [undo, redo],
- [#key("i a I A o O")], [insert; #key("Esc") back to normal],
- [#key("s") #key("S")], [regex: a cursor per match, split],
- [#key("C") #key(",")], [cursor on next line; keep primary],
- [#key("/") #key("n") #key("N")], [search, next, previous],
- [#key("m i") #key("m m")], [textobject, matching bracket],
+ [#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],
- [#key("g d") #key("g r")], [definition, references (language server)],
- [#key("Ctrl-d") #key("Ctrl-u")], [half page down, up],
- [#key("Enter") #key("Tab")], [look, execute the selection (like #btn("B3") #btn("B2"))],
+ [#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
-#table(columns: 2,
- [#key("Ctrl-w") #key("h j k l")], [focus a neighbour (not in insert or raw `$`)],
+#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 (from raw `$` only at an empty shell prompt)],
[#key("Shift-Esc")], [back to the previous pane from raw `$` or a PDF; in a terminal's normal mode, into raw],
- [#key("Ctrl-o") #key("Ctrl-i")], [jump history back, forward],
+ [#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
-#table(columns: 4,
- key("SPC ?"), [every path], key("SPC d"), word("Del"),
- 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 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"),
+#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"),
)
== Terminals and commands
@@ -131,7 +151,7 @@ Placement pardes
Every session serves its panes as files. Pane shells get `$PARDES_9P` (socket), `$PARDES_PANE` (serial).
#cmd("9ns --mntgen # m=$NINE_MOUNT/pardes/<pid|name>")
#cmd("9p -a \"unix!$PARDES_9P\" read index")
-#table(columns: 2,
+#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],