4

How can I navigate by line breaks rather than by hard breaks when wrap is turned on, so that when I go down a line I actually go down the line I see rather than the source line in the file? This would be really useful when editing really long lines, such as what come out when I am editing TeX files.

6

You can change the default behaviour of j and k adding the following lines to your .vimrc file:

nmap <silent> j gj
nmap <silent> k gk

See also vim tip 308

2

gj and gk move down and up by ‘display lines’ instead of ‘logical lines’.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.