In Vim while in the INSERT mode, I would like to be able to move between lines using the left and right arrow keys. For example, if the cursor is at the beginning of a line and I press the left arrow key, I would like the cursor to move to the last character of the previous line.
This is trivial to set up for the NORMAL mode (set whichwrap+=<,>,h,l
in .vimrc
), but how do I make it work also in the INSERT mode?
Similarly, it would be nice if also Ctrl
+Left
and Ctrl
+Right
(to move between words) worked the same way (e.g., Ctrl
+Left
would move the cursor from the beginning of the first word on a given line to the beginning of the last word on the previous line).
Thanks.
:help 'whichwrap'
also affects insert mode so you have nothing to do, Vim already behaves the way you want.,[,]
towhichwrap
in.vimrc
(–>set whichwrap+=<,>,[,],h,l
) does the trick.