Moving a row, not a sentence

Using macvim. Let's say I have one sentence that takes 5 lines in the editor. And the second sentence, which occupies the next 5 lines. Start with the cursor on line 1. In normal mode, pressing jwill lead me to the next sentence (that is, line 6).

How to change this behavior to where clicking jwill lead me to line 2 (which is still part of the first sentence?). Or instead of using j, any other way to achieve this?

+3
source share
2 answers

The actual problem is that the line (not the sentence) is too long and wraps over multiple lines of display. The default motion is with jand will kmove the cursor to real lines, rather than displaying lines.

You can remap jand kin normal mode, to move through the display lines:

nnoremap j gj
nnoremap k gk

(in your .vimrc).

+4
source

j . , ( "" , , , , ). j , , (, "" ), , . , . Vim " ". j ; gj .

+3

All Articles