Skip to main content

Module keymap

Module keymap 

Source
Expand description

Re-export shim for the static keymap catalog + keymap_entry! macro.

K.2.4.A.0.1 (2026-06-02) relocated the canonical definitions of KeymapEntry / default_keymap / lookup / entries and the keymap_entry! macro into lattice-mode::keymap_entry, so mode crates contributing keymaps via Mode::keymap() can declare bindings without depending on lattice-host. The matcher engine (KeymapTrie / KeymapLayer / BoundCommand) still lives in host; only the static catalog + entry-row metadata moved.

This shim preserves every lattice_host::keymap::{...} import path used by:

  • dispatch.rs — :describe-key static-catalog hits via crate::keymap::lookup(chord); :keymap listing via crate::keymap::{BindingMode, entries}.
  • lattice-ui-tui::keymap — re-export chain feeding the TUI drift-test catalog walker in input.rs and the app-glue reference in app.rs.
  • The various lattice-host::keymap_normal / keymap_visual / keymap_insert / keymap_replace modules that import BindingMode via crate::keymap::BindingMode.

Plan to retire the shim once downstream imports flip to lattice_mode::{KeymapEntry, keymap_entry, ...} directly.

Structs§

KeymapEntry
One row in the catalog. Ordering of fields matches the rendering order in :describe-key so reading one field at a time still tells a coherent story.

Enums§

BindingMode
Where a binding takes effect. Multi-key sequences (e.g. gg) resolve atomically; intermediate single-key prefixes (g, z) get their own descriptor entries so :describe-key g explains the pending substate.

Functions§

default_keymap
Borrow the full vim default keymap. Lazily initialised on first call (the entries embed SourceLocations which carry PathBufs and therefore can’t live in a static).
entries
Every entry of the built-in catalog in mode-grouped declaration order — identical to default_keymap. Used by :keymap.
lookup
Every row of the built-in default_keymap whose KeymapEntry::chord string equals chord exactly — across all modes, in table order. The match is on the notation string, case-sensitively, with no chord parsing or normalisation. Used by :describe-key.