2

Inside a "logical" line (I mean a vim "paragraph" = chars sequence terminated by a LF/CR), I would like to move cursor from the phisical line where the cursor is positionated to near lines, (e.g. one line UP or one line DOWN the current cursor position).

By example, in the parapraph here below, I would like to move the cursor from the bottom line to one line up to sub-word "rniamo" and again one line up word "atmosfera".

enter image description here

There is a way to do it, just with a UP/DOWN cursor movement ?

Of course the workaround is to jump directly to the word (eg with /atmosfera), but that's time consuming.

Last but not least, I would prefere a way to do that in "insert" mode, if possible (or in normal mode).

Any idea ? Suggestions ?

6

You can override your up and down movements to recognize wrapped text by remapping them to add the g key

nnoremap j gj
nnoremap k gk
| improve this answer | |
  • For insert mode I use inoremap <C-k> <C-o>gk and inoremap <C-j> <C-o>gj btw. – Martin Tournoij May 22 '15 at 14:29
  • thanks jecxjo and carpetsmoker, I do not remeber the meaning of command "g", but It work! – Giorgio Robino May 22 '15 at 14:34
  • 2
    g is a prefix to a lot of default mappings. In this case, gj and gk move up and down one visual line, not an actual line. For more on all mappings beginning with g, see :help g. – EvergreenTree May 22 '15 at 14:51

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