Why is there extra space when joining and one line ends with dot?

21 views
Skip to first unread message

Igor

unread,
Dec 14, 2019, 9:45:53 AM12/14/19
to vim_dev
Vim 8.2.0003 on Linux.

Having a text:
aaa
bbb
and cursor in first line and join the lines with J normal mode ommand and the result is:
aaa bbb
as expected.

But if there is full-stop character at the end of first line:
aaa.
bbb
and cursor also in first line and executing J
aaa.  bbb
and there double space.

Why is there a double space? Is this a bug?

The same problem appears with "!" and "?" characters instead of "."

Tony Mechelynck

unread,
Dec 14, 2019, 9:51:19 AM12/14/19
to vim_dev
No, it is not a bug, it is a feature: some manuals of style require
two spaces after a full stop or an exclamation or question mark.

See :help 'joinspaces'

Best regards,
Tony.

Igor

unread,
Dec 14, 2019, 10:06:50 AM12/14/19
to vim_dev
Tony,
little bit weird, to be set as default.

Actually to me it is important I can fix it with:
set nojoinspaces
in my .vimrc
Thanks a lot

Gary Johnson

unread,
Dec 14, 2019, 12:28:34 PM12/14/19
to vim_dev
On 2019-12-14, Igor wrote:
> Tony,
> little bit weird, to be set as default.

No, not really. All of us, at least in the U.S., who learned to
type in school around the time that vi was invented were taught to
put two spaces between sentences. Hitting the space bar twice
following end-of-sentence punctuation is automatic for us. Of
course vi would support that rule.

Regards,
Gary

Reply all
Reply to author
Forward
0 new messages