reedline icon indicating copy to clipboard operation
reedline copied to clipboard

Feature: vi visual mode

Open adaschma opened this issue 1 year ago • 3 comments

This extends the vi mode with a visual mode. Can be tested in the basic example: v to enter in normal mode. Regular movements (e.g. b,w) work and d or C to delete and reenter normal or invert mode.

adaschma avatar Jun 19 '24 17:06 adaschma

we require cargo fmt --all to be run as well. also, how can i test this. I'm not familiar with the vi keybindings.

fdncred avatar Jun 20 '24 13:06 fdncred

we require cargo fmt --all to be run as well.

fixed.

also, how can i test this. I'm not familiar with the vi keybindings.

$ cargo run --example demo -- --vi

type some text to test on.

Press "ESC" to switch into the vi normal mode and then press "v" to enter visual mode.

Now using the same keys as in vi normal mode moves the cursor while also selecting the text. These are "h" and "l" (lower case L) for moving a char left and right, or "b" and "w" for moving a word left and right, "B" and "W" for the big words, as well as "0" (zero) and "$" for the start and end of the line.

Once you have selected your text "d" deletes the selected text or "c" to delete the selected text and enter new text.

adaschma avatar Jun 21 '24 13:06 adaschma

ah, ok. thanks for taking the time to explain it to me. that helps. we really need to make the colors configurable but that's not for this pr. It just looks a bit janky (not your fault).

image

fdncred avatar Jun 21 '24 15:06 fdncred

Thanks

fdncred avatar Jul 06 '24 12:07 fdncred