Monday, October 3, 2011

executing SHFT J on certain lines of a visual selection

Hi,

I want to apply SHFT-J (join lines) on those lines starting with a number
which are followed by a line not starting with a number.

Example:

This lines:

3003 blurb foo gnats
alice bob
3409 netrino boson lightspeed
3500 icecrean I scream

will become

3003 blurb foo gnats alice bob
3409 netrino boson lightspeed
3500 icecrean I scream


I tried

:/^[0-9/normal J

but this joins all lines even when followed by a line starting with a
number

How can I acchieve this trick?

Thank you very much in advance for any help ! :)

Best regards,
mcc

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: