I have word-wrap enabled and tend to have quite long lines. But moving around inside a line that's actually 4 lines high with "w" is cumbersome. I keep using / to jump to the word I'm looking for, but that seems overdoing it a bit.
Any hints on how to move more quickly inside of a line?
Thanks,
MrB
To move left, press h . To move right, press l . To move down, press j . To move up, press k .
In normal mode or in insert mode, press Alt-j to move the current line down, or press Alt-k to move the current line up. After visually selecting a block of lines (for example, by pressing V then moving the cursor down), press Alt-j to move the whole block down, or press Alt-k to move the block up.
In insert mode, Ctrl-o escapes user to do one normal-mode command, and then return to the insert mode. The same effect can be achieved by <ESC> ing to normal mode, doing the single command and then entering back to insert mode. Ctrl-i is simply a <Tab> in insert mode.
$
, 0
, and ^
to move to line endpoints and then use w
and b
. Also, adding a numeric argument to w
and b
can accelerate the process, so using 6w
instead of just w
can put you about to where ou need to be.f
and t
to move to individual characters will help also. (I use this typically with punctuation. If, for example, I have four sentences on one long line 2f.
will go to the end of the second sentence)(
and )
keys are an alternative way to navigate entire sentences.set tw=72
[or 80]) can make editing them simpler. You can always join them later with J
.gj
and gk
. That way, you can treat your one wrapped line as multiple lines.If you comment on the type of data you're editing, it might make it easier for us to make suggestions.
I think you can benefit from gk and gj instead of just k and j.
Also look at 'virtualedit'
for some options that allow you to cursor through 'void' areas without flicking the cursor to the next best physical character.
You might want to (temporarily)
nnoremap <buffer> k gk nnoremap <buffer> j gj
Leave out the <buffer>
part to apply this globally.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With