[CLUE-Tech] vim question: doing a large document using join

Kevin Cullis kevincu at orci.com
Tue May 7 10:55:46 MDT 2002


Todd,

"Todd A. Gibson" wrote:
> 
> On Tue, May 07, 2002 at 12:09:57AM -0600, Kevin Cullis wrote:
> > Hi all,
> >
> > My normal way of copying large blocks of text is to use my mouse and
> > "cut and paste" into vim and then do searches for multiple spaces to
> > make the text line up on the left. However, I now have multiple lines to
> > use the join command. I've been searching for regexp to find the answer,
> > but I thought I'd ask you all your opinion on any better ways of doing
> > this task. The task is cutting and pasting, normally, web site info,
> > into vim and then editing the text for formating.
> >
> 
> I'm not sure I understand based on this description.  It almost sounds
> like you need the command-line tool 'paste' but I'm not sure that's what
> you're asking.

No, I know about the paste command.

> 
> If you want to properly line-break a messed up paragraph of text, go to
> the top line of the paragraph and type:
> V}gq
> 
> But that may not be what you are asking for either...

Not quite.  Basically, anytime I paste into vim from a copied web page I
get this:

                       There's a letter circulating, purportedly from 
                       Villanueva Nuñez to Microsoft Peru, which cuts 
                       'panic points' to chill those considering. 

I use this command to get rid of the extra spaces:

:%s/  *//g

That leaves me with this:

There's a letter circulating, purportedly from 
Villanueva Nuñez to Microsoft Peru, which cuts 
'panic points' to chill those considering. 

What I'm looking for is taking the above and making it come out like
this:

There's a letter circulating, purportedly from Villanueva Nuñez to
Microsoft Peru, which cuts 'panic points' to chill those considering. 

How do I do this without doing a join on each paragraph?  I'd like to
have one command to join the whole document at once.  While I could use
sed or awk, sometimes I don't need sed and vim is good enough. Is this
possible?

Does this help some more?

Kevin



More information about the clue-tech mailing list