4

(Disclamer: I'm new to Vim.)

I've mistakenly managed to enable cursor movements to travel anywhere on the screen, i.e. beyond end of lines. This makes it very tedious to spot redundant whitespaces, etc.

What setting might it be that I've touched to accomplish this messy behavior? And how do I set it back to a behavior that stops the cursor when it hits the end of a line?

1 Answer 1

3

This behavior is controlled by the 'virtualedit' option. Execute

:set ve?

to see what it's currently set to. It will probably be "all". If that's the case, just execute

:set ve=

to reset it. If your Vim behaves this way all the time, you can execute

:verbose set ve?

to see where it was last set and fix the problem there. Also see

:help 've'
2
  • 1
    Ah, there we have it. Thanks! The :verbose set ve? command proved invaluable! (Seems I had defined set virtualedit=all in my .vimrc and removing it did the trick.)
    – Henrik
    Apr 27, 2012 at 17:37
  • And in lua for nvim ?
    – Stephane
    Feb 19, 2022 at 6:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .