Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move to end of line in vim with virtualedit=all and set wrap

Tags:

vim

How to move to end of a screen line in vim with set virtualedit=all and set wrap when a long line is splited into several screen lines?

I want a shortcut, l not count.

like image 404
j5shi Avatar asked Oct 19 '25 15:10

j5shi


1 Answers

g$ brings you to the end of the current screen line. You're right that :set virtualedit=all changes that to the last possible screen column, even if that doesn't physically exist in the file (which is what virtual edit is about). With normal, single-space word spacing, you could correct that via gEl (back to end of last word + right), but for the general case, you will have to (temporarily) unset 'virtualedit'. This shortcut works:

g$:set ve= ve=all<CR>
like image 177
Ingo Karkat Avatar answered Oct 21 '25 05:10

Ingo Karkat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!