In vim , what command should be used if I wanna join next line when current line does not end with space.
original text:
aaaa(space)
bbbbx
cccc
after command :
aaaa(space)
bbbbxcccc
:g/^.*(!\s)$/,/./-j gives error
I am not familiar with VI.
Thanks!
Regex is a little bit special in VI.
You have to escape some operations. Therefore use
\vat the beginning of your pattern, if you want normal behaviour.The following pattern does what you want:
As you can see there is a
%sin front of it. Which is similar to sed. Instead of%you can also use2,3which are lines, where the regex should be executed.