Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

(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

1 Answer 1

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.) –  hced Apr 27 '12 at 17:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.