Open brainwo opened 2 years ago
Just to say that I'm rooting for this feature too.
Same here - any idea on how this might be done @jeffreytse? We might be able to put in a PR for this feature
I've opened a PR to add this in @jeffreytse 😃 Check out #177
Looks like my PR has been closed. Owner might have a different approach to doing this
Looks like @kangadrewie's fix didn't accept a count. So neither 3gj nor 2gk would work. There is also a change that looks like a typo in the zvm_escape_non_printed_characters() function.
Hi @kangadrewie
Thanks for your contribution, I didn't close your PR, and as @gonubana said, there is a typo in the zvm_escape_non_printed_characters()
function. : )
Thanks & Regards
I started looking at this for my own plugin, and it gets super complex if you want to do it totally correctly. You could probably get away with this (accepts count):
zvm_up_visual_line(){
zle -f vichange
((CURSOR += NUMERIC * COLUMNS))
}
zvm_down_visual_line(){
zle -f vichange
((CURSOR -= NUMERIC * COLUMNS))
}
But this only works if:
This might be good enough to appease most people; while I use multi-line editing a fair bit (I have a widget which loads a function definition into the buffer, which always is multi-line and tabbed) I'm not sure how much others do. There's an extra complexity which happen when moving to or from the first line, where the prompt isn't accounted for in the visual count.
I'm still writing my more complete implementation, but I think I'lll probably resort to using terminfo[u7]
to ask the terminal where the cursor is.
Basic examination
Problem description
Can't get
gj
andgk
to workReproduction steps
gk
in normal modeExpected behavior
Move up and down through the wrapping lines (like what Vim does)