If your goal is to automate paragraph join I would approach it with the help of :global
and :normal
commands:
:g/^\S/normal! vipJ
That will convert whole buffer like
He was aware there were numerous wonders of this world including the
unexplained creations of humankind that showed the wonder of our
ingenuity. There are huge heads on Easter Island. There are the
Egyptian pyramids. There’s Stonehenge. But he now stood in front of a
newly discovered monument that simply didn't make any sense and he
wondered how he was ever going to be able to explain it.
The wave crashed and hit the sandcastle head-on. The sandcastle began
to melt under the waves force and as the wave receded, half the
sandcastle was gone. The next wave hit, not quite as strong, but still
managed to cover the remains of the sandcastle and take more of it
away. The third wave, a big one, crashed over the sandcastle completely
covering and engulfing it. When it receded, there was no trace the
sandcastle ever existed and hours of hard work disappeared forever.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas feugiat
fermentum pretium. Cras eu dolor imperdiet justo mattis pulvinar. Cras nec
lectus ligula. Proin elementum luctus elit, a tincidunt quam facilisis non.
Nunc quis mauris non turpis finibus luctus. Maecenas ante sapien, sagittis
quis accumsan in, feugiat quis sem.
to
He was aware there were numerous wonders of this world including the unexplained creations of humankind that showed the wonder of our ingenuity. There are huge heads on Easter Island. There are the Egyptian pyramids. There’s Stonehenge. But he now stood in front of a newly discovered monument that simply didn't make any sense and he wondered how he was ever going to be able to explain it.
The wave crashed and hit the sandcastle head-on. The sandcastle began to melt under the waves force and as the wave receded, half the sandcastle was gone. The next wave hit, not quite as strong, but still managed to cover the remains of the sandcastle and take more of it away. The third wave, a big one, crashed over the sandcastle completely covering and engulfing it. When it receded, there was no trace the sandcastle ever existed and hours of hard work disappeared forever.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas feugiat fermentum pretium. Cras eu dolor imperdiet justo mattis pulvinar. Cras nec lectus ligula. Proin elementum luctus elit, a tincidunt quam facilisis non. Nunc quis mauris non turpis finibus luctus. Maecenas ante sapien, sagittis quis accumsan in, feugiat quis sem.
Note that visual selection is still activated with :normal
but you can't see it.
Another way to do it would be macro recording or explicit ranges given to :join
command.
gq}
orgqG
might do what you want.gq
to format, and}
motion to go to the end of the paragraph, orG
to go to end of the file. This is not exactly the same as what you asked for since it doesn't "join" lines but rather reformats them, but it may cover your use-case.