vim-line: A line-oriented vim motions library for TUI applications
This crate provides a trait-based interface for line editing with vim-style keybindings. It's designed for "one-shot" editing scenarios like REPLs, chat inputs, and command lines - not full buffer/file editing.
Design Philosophy
- Host-agnostic: The library doesn't know about terminals or rendering
- Command-based: Returns mutations for the host to apply
- Caller owns text: The library never stores your text buffer
- Multi-line aware: Supports inputs with newlines that grow/shrink
Example
use ;
let mut editor = new;
let mut text = Stringfrom;
// Process 'dw' to delete word
let _ = editor.handle_key;
let result = editor.handle_key;
// Apply edits
for edit in result.edits.into_iter.rev
// text is now "world"