Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

(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?

share|improve this question
up vote 2 down vote accepted

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'
share|improve this answer
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 '12 at 17:37

You must log in to answer this question.

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