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.

link|improve this question

75% accept rate
feedback

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=
link|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
feedback

Your Answer

 
or
required, but never shown

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