diff options
| author | user <user@clank> | 2026-08-15 11:11:11 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-15 11:11:11 +0200 |
| commit | ffd73be0f9fc1d03ed832e5215f9a89f6de1e960 (patch) | |
| tree | a0e88ea63eeb7c8fb4db6a30531c66109ef54bfd /config | |
| parent | sl0ppty: colour the states that mean a pane is not live (diff) | |
| download | slosh-ffd73be0f9fc1d03ed832e5215f9a89f6de1e960.tar.gz slosh-ffd73be0f9fc1d03ed832e5215f9a89f6de1e960.tar.xz slosh-ffd73be0f9fc1d03ed832e5215f9a89f6de1e960.zip | |
sl0ppty: C-a ? shows every binding you have
A prefix-key multiplexer is unusable until you know its keys, and the only
place they were written down was a config file and a README. Now they are one
keystroke away, in a pane-shaped modal floating over the layout.
It is built from CFG.binds, not from a list of what the defaults are. Rebind
something and the sheet says what you bound; unbind it (`bind "-" "none"`)
and it stops advertising it; change the prefix and the "C-a then:" line at the
top changes with it. A cheatsheet that can disagree with the keyboard is worse
than no cheatsheet, and it would disagree the first time anybody edited a
config -- so it cannot be a list.
Bindings that share an action are merged onto one row: `h ←` is one thing to
learn, not two, and the nine tab digits are `1…9` rather than nine rows.
Keys are named the way you press them -- `\` and `?` and `H`, not "backslash"
and "S-slash" and "shift+h" -- and both spellings still parse as config, so
the sheet stays copyable.
The frame is a pane's frame, corners and title and close button, because a
dialog should wear the chrome of the program it belongs to. It fills its own
background: a modal you can read a shell prompt through is one nobody trusts.
Two columns when there is room, one when there is not, split at a group
boundary so a heading never ends a column alone, and every string clipped at
the frame -- a small terminal loses words rather than its border.
Any key dismisses it, and that key does nothing else: dismissing a modal must
not also run the thing you happened to press. A click anywhere does the same
and does not reach what it landed on.
`?` is bound twice, to shift+slash and to slash, because whether it arrives
with a modifier depends on the outer terminal: as a plain byte there is no
shift to be had, and under the kitty keyboard protocol -- which our own client
asks for -- there is. Binding one of them is a binding that works on the
machine it was written on.
Diffstat (limited to 'config')
| -rw-r--r-- | config/config.kdl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/config/config.kdl b/config/config.kdl index 3aa0e38..dd50cdd 100644 --- a/config/config.kdl +++ b/config/config.kdl @@ -407,7 +407,8 @@ theme { // Actions: split-cols split-rows close-pane focus-left focus-right focus-up // focus-down focus-next resize-left resize-right resize-up resize-down // scroll-up scroll-down scroll-page-up scroll-page-down scroll-top -// scroll-bottom zoom minimize rerun new-tab next-tab prev-tab select-tab-1..9 finder detach quit +// scroll-bottom zoom minimize rerun new-tab next-tab prev-tab select-tab-1..9 finder +// help detach quit // literal-prefix none keys { @@ -448,6 +449,12 @@ keys { bind "f" "finder" + // The cheatsheet, built from whatever is bound below rather than from a + // list of what the defaults were -- rebind something and it says so. + // Bound twice because a terminal may or may not tell us `?` was shifted. + bind "?" "help" + bind "/" "help" + // Scrollback. The wheel does this too, unless the program in the pane // wants the mouse itself, or is a full-screen program with no scrollback // of ours to show — then the wheel means arrow keys to it. |
