Some lines in a file are more than the screen width and they are all…

…wrapped. When I use the j, k keys to move from one line to the next, the cursor is moved to the next line in the file instead of the next line on the screen. How do I move from one screen line to the next?

You can use the gj and gk commands to move from one screen line to the next/previous screen line. The j and k commands move the cursor from one file line to the next file line. You can also avoid the line wrapping by resetting the ‘wrap’ option:

    :set nowrap

Read: gj gk ‘wrap’ You can use the following appings:

    :map  gk

    :imap  gk

    :map  gj

    :imap  gj

    :noremap j gj

    :noremap k gk

    :map  gk

    :imap  gk

    :map  gj

    :imap  gj

    :noremap j gj

    :noremap k gk

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