Skip to main content

Module keymap

Module keymap 

Source
Expand description

Key resolution: chords in, command ids out.

Three behaviours here are worth more than they look:

  • Counts. 7j means seven, and it composes with any motion, because the count is accumulated by the resolver rather than by each command.
  • Prefixes. An incomplete sequence resolves to Resolution::Pending carrying the keys that would complete it. That list is exactly what the which-key popup draws, so the popup can never disagree with the keymap.
  • Flushing. An unmatched sequence returns the chords it swallowed. That is what lets jk leave Insert mode without eating a literal j typed before some other letter.

Structs§

Binding
Keymap
Pending
Keys held while waiting for a sequence to complete.
PendingEntry
A key that could come next, for the which-key popup.

Enums§

Resolution

Functions§

default_keymap
The default keymap.