feat(keymap,proxy): Alt+H global keybindings cheat-sheet#67
Merged
Conversation
Adds two optional fields to `keymap.Binding` — `label` (display name) and `description` (one-line action explanation). The new `renderHelp()` walker dumps all annotated bindings into shell history as a dim-chrome banner with cyan keys + dim descriptions, matching the LLM conclusion-banner palette. `Alt+H` reuses the existing `llm_exec_toggle_help` binding with a fall-through: when the LLM module returns "not consumed" (user isn't in AI mode), the proxy renders the global cheat-sheet instead. So Alt+H is now useful regardless of mode — AI hint when typing `#: …`, keybindings cheat-sheet otherwise. Dual-encoded sibling bindings (legacy + kitty-kbd CSI-u for the same chord) leave the SECOND entry with empty label, so the help renderer deduplicates by enum index — only the first non-empty annotation per action is shown. Annotated the shipped default bindings: Right, Ctrl+Right, Ctrl+Shift+I, Ctrl+Shift+D, Alt+A, Alt+S, Alt+Shift+S, Alt+M, Alt+H, Alt+C, Alt+Shift+C, Ctrl+Shift+X. User configs that supply their own `bindings: []const Binding` keep working — both new fields default to `""` (no help entry). Follow-up work (out of scope for this PR): modules registering their OWN `default_bindings` array via a comptime hook + dispatcher walker. The foundation here (Binding.label/description) supports that extension; just need to wire the walker. `zig build test` (472 pass) + `zig fmt --check` clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…not direct binding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Alt+Hnow opens a one-screen cheat-sheet of every annotated keybinding — pulled fromconfig.keymap.bindings, scrolled into shell history (like the LLM conclusion banner) so it stays available in scrollback.Adds two optional fields to
keymap.Binding:label: []const u8 = ""— display name (e.g."Alt+C")description: []const u8 = ""— one-line action explanationBindings with EITHER field empty are hidden from help. Dual-encoded sibling bindings (legacy + kitty-kbd for the same chord) leave the second blank — the renderer deduplicates by enum index so each action shows once.
Alt+Hreuses the existingllm_exec_toggle_helpbinding with a fall-through: when the LLM module returns "not consumed" (user isn't in AI mode), the proxy renders the global cheat-sheet instead. SoAlt+His useful in BOTH contexts — AI hint when typing#: …, full cheat-sheet otherwise.Annotated bindings
Right, Ctrl+Right, Ctrl+Shift+I, Ctrl+Shift+D, Alt+A, Alt+S, Alt+Shift+S, Alt+M, Alt+H, Alt+C, Alt+Shift+C, Ctrl+Shift+X.
Follow-up (not this PR)
The user's original request was for modules to register their own bindings, with help auto-listing them. This PR adds the
Binding.label/descriptioninfrastructure that supports that. Wiring the comptime walker (each module exposespub const default_bindings: []const Binding = &.{...}and the dispatcher concats them) is a follow-up that doesn't change existing behaviour — it just moves the source-of-truth fromdefaults.ziginto the modules. Filed as a follow-up.Test plan
zig build test— 472/472 pass (includes newBinding label/description defaultstest)zig fmt --check— clean#: …→ existing LLM hint still surfaces🤖 Generated with Claude Code