hjkl-vim 0.16.0

Vim modal state types and grammar primitives for the hjkl editor stack. Pre-1.0 churn.
Documentation
/// Cursor motion identity carried by the host keymap path.
///
/// Phase 3a introduces this enum so the `hjkl-vim` keymap can name motions
/// without depending on engine internals. The host converts a `MotionKind` to
/// the appropriate `Editor::apply_motion` call.
///
/// Designed for extensibility: Phases 3b–3g will add further variants
/// (word motions, line-boundary motions, jump motions, scroll motions, …)
/// without breaking any existing match arms — callers must use `..` or
/// add the new arms when they bump the hjkl-vim minor version.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum MotionKind {
    /// `h` / `<Backspace>` — move the cursor one character to the left.
    /// Clamps at column 0 (no line-wrap), matching vim's normal-mode `h`.
    CharLeft,
    /// `l` / `<Space>` — move the cursor one character to the right.
    /// Clamps at the last character of the line (no line-wrap), matching
    /// vim's normal-mode `l`.
    CharRight,
    /// `j` — move the cursor one line down, restoring the sticky column.
    LineDown,
    /// `k` — move the cursor one line up, restoring the sticky column.
    LineUp,
    /// `+` / `<CR>` (not yet bound) — move down one line and land on the
    /// first non-blank character. Sets the sticky column.
    FirstNonBlankDown,
    /// `-` — move up one line and land on the first non-blank character.
    /// Sets the sticky column.
    FirstNonBlankUp,
    /// `w` — move the cursor forward to the start of the next small word.
    /// Counts repeat the motion; wraps across lines matching vim's `w`.
    WordForward,
    /// `W` — move the cursor forward to the start of the next BIG word
    /// (whitespace-delimited). Counts repeat; wraps across lines.
    BigWordForward,
    /// `b` — move the cursor backward to the start of the current or previous
    /// small word. Counts repeat; wraps across lines matching vim's `b`.
    WordBackward,
    /// `B` — move the cursor backward to the start of the current or previous
    /// BIG word (whitespace-delimited). Counts repeat; wraps across lines.
    BigWordBackward,
    /// `e` — move the cursor forward to the end of the current or next small
    /// word. Counts repeat; wraps across lines matching vim's `e`.
    WordEnd,
    /// `E` — move the cursor forward to the end of the current or next BIG
    /// word (whitespace-delimited). Counts repeat; wraps across lines.
    BigWordEnd,
    /// `0` / `<Home>` — move the cursor to the first column of the current
    /// line (column 0). Count is ignored (vim `0` is always a plain motion).
    LineStart,
    /// `^` — move the cursor to the first non-blank character on the current
    /// line. On a blank/all-whitespace line, lands at column 0.
    FirstNonBlank,
    /// `$` / `<End>` — move the cursor to the last character on the current
    /// line. On an empty line, stays at column 0. Count-aware: `count$`
    /// moves down `count-1` lines, then lands at the end of that line.
    LineEnd,
    /// `G` — go to line. Count semantics match vim:
    /// - count 0 or 1 (bare `G`) → last line of buffer.
    /// - count > 1 → jump to that line number (1-based).
    ///
    /// Note: `gg` (first line) is dispatched via the G-chord path
    /// (`Editor::after_g`), not via this variant.
    GotoLine,
    /// `;` — repeat last `f`/`F`/`t`/`T` in the same direction.
    /// No-op if no prior find exists.
    FindRepeat,
    /// `,` — repeat last `f`/`F`/`t`/`T` in the reverse direction.
    /// No-op if no prior find exists.
    FindRepeatReverse,
}