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

Read free Software Algorithms and Computer Science Books by CodeAhoy Learn.

Introduction to Recursion and Backtracking

Sorting Algorithms

Introduction to C Programming Language

And More...

Speak Your Mind