Expand description
K.3.2 (2026-06-02): help-prefix (<C-h> map) bindings.
Emacs-style discoverability for the §5.11 self-documenting
help facility. From any Normal-mode buffer, <C-h> is a
prefix that opens the help workflow:
| Chord | Command | What it does |
|---|---|---|
<C-h> <C-h> | :help-for-help | Open help index. |
<C-h> ? | :help-for-help | Alias — easier to type. |
<C-h> k | :describe-key | Prompt for chord, show binding. |
<C-h> c | :describe-command | Prompt for command name. |
<C-h> o | :describe-option | Prompt for option name. |
<C-h> e | :describe-event | Prompt for typed-event name. |
<C-h> f | :describe-element | Prompt for theme element / face name. |
<C-h> m | :describe-active-modes | Active major + minors on this buffer, with their chords. |
<C-h> M | :describe-mode | Prompt for a mode name; show that mode’s metadata. |
<C-h> b | :describe-buffer | Buffer metadata (kind, flags, modes, …). |
<C-h> a | :apropos | Cross-cutting search. |
<C-h> K | :describe-bindings | Chords that can fire on this buffer. :keymap remains the full catalog. |
§DAM.4 correction (2026-08-04)
K.3.2 bound <C-h>m to :describe-mode, whose name arg is
ArgDefault::Required — so the no-arg invocation armed the
interactive mode: prompt and asked which mode to describe. It
never showed the active modes, though this table, the
HelpPrefixEntry doc, and keymap-architecture §12.1 all said it
did. <C-h>m now routes to :describe-active-modes; <C-h>M
keeps the prompt-for-any-mode path that <C-h>m was accidentally
providing, so nothing is lost.
The m / M pair reads listing-then-specific while the older
k / K pair reads specific-then-listing. Deliberate: lowercase
is the common case in both, and C-h m = active modes is the
emacs muscle memory worth preserving.
§Design choices (per K.3 slice plan)
- No bare
<C-h>leaf. K.3.0’s trie audit found that today’s matcher returnsBoundimmediately when a node carries a binding, even if it also has children — and the dispatcher has notimeoutlenmachinery to wait for a follow-on chord. Vim’s “leaf + prefix” ambiguity needs timer-driven dispatch which isn’t worth introducing for a single help affordance. Instead,<C-h>is a pure prefix node (returnsPartial), and the slice plan’s listed alternative<C-h><C-h>(plus the easier-to-type<C-h>?) is the explicit help-for-help entry. One keystroke of extra friction; zero new infrastructure. - Normal mode only. Insert / Visual / OperatorPending /
Cmdline retain their existing
<C-h>semantics (Insert keeps backspace; cmdline keeps cmdline-backspace). The K.1.c per-keystroke filter naturally enforces this because bindings are registered withBindingMode::Normal; other modes simply don’t match. KeymapLayer::Builtin. Universal availability across every Normal-mode buffer — same shape as Normal-mode motions, operators, and the rest of the vim default catalog. The mode-architecture §13 convention (“feature- gated bindings live at MinorMode”) doesn’t apply here because the help prefix isn’t feature-gated; it’s a universal discoverability affordance.
Functions§
- register_
help_ prefix_ bindings - Register the
<C-h>help-prefix bindings into the supplied handle’sBuiltinlayer atBindingMode::Normal.