aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-15 20:57:55 +0200
committeruser <user@clank>2026-08-15 20:57:55 +0200
commit6857bb410d8cd7974a801876a4edd9d1daf6d17b (patch)
tree26f1e5118efd015fce441dc00698b7d2a51949c5 /config
parentsl0ppty: make the finder a modal, and a picker worth using (diff)
downloadslosh-6857bb410d8cd7974a801876a4edd9d1daf6d17b.tar.gz
slosh-6857bb410d8cd7974a801876a4edd9d1daf6d17b.tar.xz
slosh-6857bb410d8cd7974a801876a4edd9d1daf6d17b.zip
sl0ppty: a command palette, on a key you choose
Every action by name, without having to know its key. The cheatsheet answers "what is the key for this?" and then needs you to press it; this answers "just do the thing", which is the question you have when you cannot remember there was a key at all. `C-a shift+p` by default, and `bind "<key>" "palette"` for anything else. It lists actions that are bound to nothing, which the cheatsheet by design cannot -- that sheet is built from the binds, so an action with no key does not appear on it, and that is exactly the action you have no other way to reach. Two of ours are in that state today (scroll by a line, either direction). Where a binding does exist the palette shows it beside the row, so using the palette teaches the key that would have skipped it. Where several exist it shows them all: a config's binds add to the defaults rather than replacing them, so naming only the first would hide the one the user actually chose. Rows match on the phrase, the group, and the name a config file uses, so "split into columns", "panes" and "split-cols" all find the same thing depending on whether you have been editing the config lately. The finder and the palette are now one picker with a subject rather than two machines that would drift -- the same modal, query, filtered list, selection, keys and mouse rules, differing only in what fills the rows and what Enter does with one. Choosing goes through the row's own action string, so the keyboard and the mouse cannot take different paths to the same row. The finder's 55 checks pass unchanged across the refactor. Left out on purpose: `literal-prefix`, which means "type this key" rather than "do this thing" and picked from a list would send the prefix to a pane hidden behind that list; and `select-tab-N`, which is positional, so a row reading "go to that tab" cannot say which. Running is by action rather than by synthesising the keystroke that would have caused it -- a palette that had to invent input to do its job would be lying to the rest of the program about what happened. That meant splitting prefix_command in two, which it wanted anyway: the lookup and the doing were only ever together by accident.
Diffstat (limited to 'config')
-rw-r--r--config/config.kdl6
1 files changed, 5 insertions, 1 deletions
diff --git a/config/config.kdl b/config/config.kdl
index b016b97..d3a7dc3 100644
--- a/config/config.kdl
+++ b/config/config.kdl
@@ -500,7 +500,7 @@ theme {
// 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
-// help detach quit
+// palette help detach quit
// literal-prefix none
// What C-a e opens this file with. Empty means $EDITOR, and then vi -- the
@@ -558,6 +558,10 @@ keys {
bind "f" "finder"
+ // Every action by name, including the ones nothing is bound to -- which
+ // is the whole point of it, since an unbound action has no other way in.
+ bind "shift+p" "palette"
+
// 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.