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.

When using the arrow keys in Vim on Linux, they act the same way as h and l , stopping when the end of a line is reached. GVim on Windows doesn't do this, instead allowing the arrow keys continue past the end (or beginning) of a line and on to the next line.

Is there any way to change the arrow key behaviour and cause them to stop at the end of a line like the character navigation keys?

NOTE: I am not looking for a way to get to the beginning or end of a line, I realize that 0 and $ do this.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

add this to your .vimrc file:

set whichwrap=b,s,h,l,<,>,~,[,]

to enable moving the cursor to the next line.

And to disable (I think):

set whichwrap=
share|improve this answer
    
Thanks, worked like a charm. Just a note for other people new to Windows GVim, the file is _vimrc for windows systems. –  viking Jun 30 '11 at 16:37
add comment

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.