Skip to content

feat(vault-tui): tui.vim — vim jump motions#20

Merged
UnbreakableMJ merged 1 commit into
mainfrom
tui-vim
Jun 15, 2026
Merged

feat(vault-tui): tui.vim — vim jump motions#20
UnbreakableMJ merged 1 commit into
mainfrom
tui-vim

Conversation

@UnbreakableMJ

Copy link
Copy Markdown
Contributor

What

Opt-in tui.vim (the last tracked config key). On top of the default hjkl
navigation, the browser gains the vim jump motions:

  • gg → top, G → bottom
  • Ctrl-d / Ctrl-u → half-page (a fixed step — the pure-render App has no
    viewport height)

Because g becomes the gg prefix in vim mode, the generator overlay moves
from g to Ctrl-g
while vim mode is on. Non-vim mode is unchanged (g
opens the generator). Decided with the user.

How

  • vault-config: [tui] table + tui.vim (bool) — a TUI-only preference,
    read by vault-tui directly (not relayed to the agent), mirroring
    ui.reduced_motion.
  • vault-tui: App.vim + a pending_g gg-prefix flag; new focus-aware
    motions move_top/move_bottom/page_up/page_down reusing the existing
    move_* re-masking pattern. handle_normal_key intercepts the vim keys
    before the normal match (which matches g/u/d without checking
    modifiers, so Ctrl-d/Ctrl-u would otherwise alias delete/copy-username).
    load_app sets app.vim from config.

This completes the PRD §7.1 config registry.

Tests

  • vault-config: tui.vim round-trip / rejects non-boolean / asserted never an
    agent flag.
  • vault-tui: move_top/move_bottom land on first/last, page_* clamp to
    bounds, move_bottom on an empty list is a no-op, and the gg prefix
    arms-once-then-fires.

Local CI-exact gates all green: fmt, fresh isolated clippy -D warnings
(the new App bools needed a reasoned #[expect(struct_excessive_bools)]
they're independent toggles, not a state enum), cargo test --workspace --all-targets under RUSTFLAGS=-D warnings, cargo deny check (no new deps),
both headless builds.

🤖 Generated with Claude Code

Opt-in `tui.vim`: on top of the default hjkl, the browser gains gg (top), G
(bottom), and Ctrl-d/Ctrl-u (half-page). Because `g` becomes the gg-prefix in
vim mode, the generator overlay moves from `g` to Ctrl-g; non-vim mode is
unchanged (g = generator).

- vault-config: tui.vim key ([tui] table, bool) — TUI-only, not relayed to
  the agent (mirrors ui.reduced_motion).
- vault-tui: App.vim + pending_g; move_top/move_bottom/page_up/page_down
  (focus-aware, re-masking, fixed VIM_PAGE step — the pure-render App has no
  viewport height); handle_normal_key vim intercept before the modifier-less
  g/u/d arms; load_app sets app.vim from config.

Completes the PRD §7.1 config registry.

Tests: vault-config round-trip / reject / not-an-agent-flag; vault-tui jump +
clamp + empty-list no-op + the gg arm/take sequence.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@UnbreakableMJ
UnbreakableMJ merged commit 5721a6c into main Jun 15, 2026
8 checks passed
@UnbreakableMJ
UnbreakableMJ deleted the tui-vim branch June 15, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant