Home » Questions » Computers [ Ask a new question ]

In vim, how do I make the left and right arrow keys change line?

In vim, how do I make the left and right arrow keys change line?

In vim, my arrow keys work correctly, moving up, down, left, and right as expected, with one exception. At the beginning of a line, left arrow does nothing, instead of going to the last character of the previous line. At the end of a line, right arrow does nothing, instead of going to the first character of the next line.

Asked by: Guest | Views: 58
Total answers/comments: 2
Guest [Entry]

"After some further Googling, I found the answer is to use the whichwrap option.

Vim Faq
Vim documentation on whichwrap option

I added the following line to my .vimrc:

set whichwrap+=<,>,[,]

The < and > options turn on the desired setting for normal mode and [ and ] turn on the desired setting for insert mode."
Guest [Entry]

This is default behavior - you can always use Home and End to jump to the start and finish of a line however.