vtcode-vim
Reusable Vim-style prompt editing engine for VT Code surfaces.
Implement the Editor trait on any text buffer and call handle_key to get
Normal/Insert mode editing, motions, operators, and dot-repeat out of the box.
Usage
use ;
use ;
// Drive editing with key events:
let mut state = new;
let mut editor = MyEditor ;
let mut clipboard = Stringnew;
let outcome = handle_key;
assert!;
API reference
| Item | Description |
|---|---|
Editor (trait) |
Minimal text-surface interface: content, cursor, set_cursor, move_left, move_right, delete_char_forward, insert_text, replace |
handle_key(state, editor, clipboard, key) -> HandleKeyOutcome |
Route a single crossterm::KeyEvent through the Vim engine |
HandleKeyOutcome |
Result struct with handled and clear_selection flags |
VimMode |
Normal or Insert |
VimState |
Tracks current mode, pending operator, and repeat state |