remove new line and bring next line up

vu pham vu at sivell.com
Fri Apr 9 18:58:57 PDT 2010


On 04/09/2010 03:25 PM, C M Reinehr wrote:
> On Fri 09 April 2010 02:09:44 pm Vu Pham wrote:
>    
>> In vi, I use J at the end of a line to move the next line up next to the
>> current line. How can I do it over many lines by one or two commands ?
>>
>> What I want is to convert
>>
>> a,
>> b,
>> c,
>> d,
>> e
>>
>> to a,b,c,d,e
>>
>>
>> I tried
>>
>> :n,m s/control-VcontrolJ//g
>>
>> but it fails.
>>
>> Thanks,
>> Vu
>>      
> Vu,
>
> I I'm understanding you correctly, with your cursor position on the line
> containing 'a', you just would type ".,+4j". This will leave embedded spaces,
> so you would have to follow it up with "s/ //g" to remove the spaces.
>    
CM, great, this works too. I think you mean ":.,+4j".
Thanks,
Vu



More information about the Linux-users mailing list