Delete backwards from cursor to the end of the previous line in Vim?

What you want is the line join command, J.

In normal mode, put your cursor anywhere on the var myVar = line and type J (capital j).

Direction-wise motions work with J - 5J indents 5 lines below the cursor, etc. You can also select a range of lines using visual mode (v to start visual mode selection) and join them all into one using J.

The &joinspaces option affects this behavior as well. When it's "on" (set joinspaces or set js) it adds two spaces after a sentence-ending mark (i.e. '.', '?', or '!') when joining lines. set nojoinspaces or set nojs to turn that off and insert only one space.

Tags:

Vi

Vim