Monday, November 30, 2009

Re: ctrl+J without adding a space

> That said, "ctrl+J"? Isn't that just a newline? On my keyboard, shift-J
> joins two lines, adding a space between them (and trimming any leading
> space that may have been on the line below).

Correct -- Either the OP has a mapping, or mis-typed
"shift+J"/"capital J" which does as described (joins with extra
whitespace.

:help J
:help gJ

I find that by the time I think about whether I want whitespace
added or not, typing the "g" is less overhead than remembering a
non-standard mapping, so I just use the stock J/gJ when joining.

As an aside, it can also be done as an Ex command, using either

:j
:j!

which can be nice in a global command like

:g/pattern/,+3j

to join every line matching /pattern/ with the following 3 lines.

-tim


--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments: