How do I configure Vim to move the cursor to the end of the previous…

…line, when the left arrow key is pressed and the cursor is currently at the beginning of a line?

You can add the ‘<’ flag to the ‘whichwrap’ option to configure Vim to move the cursor to the end of the previous line, when the left arrow key is pressed and the cursor is currently at the beginning of a line:

    :set whichwrap+=<

Similarly, to move the cursor the beginning of the next line, when the right arrow key is pressed and the cursor is currently at the end of a line, add the ‘>’ flag to the ‘whichwrap’ option:

    :set whichwrap+=>

The above will work only in normal and visual modes. To use this in insert and replace modes, add the ‘[’ and ‘]’ flags respectively. For more information, read: ‘whichwrap’ 05.7

Comments (1)


Pepsh Pepshinsky

Let’s see you to :help viminfo-file-name (option -i) :set viminfofile=NONE


Speak Your Mind