From: Pete Johns <[EMAIL PROTECTED]>
Subject: Re: Two """problems"""
Date: Thu, 14 Sep 2006 13:46:42 +1000



> On Thu, 2006-09-14 at 04:45:12 +0200, Meino Christian Cramer sent:
> >2.) Currently I am reading the ascii version of the vimtips
> >file.  One thing I would like to change physically (that means:
> >The file should be changed that way, not only the visual
> >representation...) are the super long lines into 72 chars ones.
> >My attempt to do this was
> >
> >                     gqG
> >
> >    which reformats /everything/ (even the embedded scripts). As
> >    long as it was floating text, the result was ok, but the
> >    scripts were """obfuscated""".
> >
> > I would like to apply the gq-command only to lines longer than
> > 72 chars -- so the scripts were automagically skipped (as I
> > hope...).
> >
> >    How can I accomplish this ?
> >
> Here's my attempt:
> 
>     """"" For all lines longer than 72 characters, reformat the
>     """"" paragraph from that line..
>     1,$g/.\{73,}/normal v}gq
> 
> Hope this helps;
> 
> 
> --paj
> 
> -- 
> Pete Johns                                   <http://johnsy.com/>
> Contact Information                  <http://johnsy.com/contact/>
> More On OptusNet               <http://johnsy.com/20060912132225>
> dsc00220              <http://johnsy.com/albums/flickr/210370644>

Hi Pete!

 thank you very much for this "line of code" -- works like a charme!

 The only """bad""" thing is: I dont understand completly, how it
 works....

 This far I got:

 1,$        for the beginning of the text til its end do
 /.\{73,}/  find all lines longer than 72 chars and for each do
 normal     ??? go into normal mode ???
  v         ????? visual mode (and for what is the " " good for?) ????
 }gq        ???????? only white noise for me....a C-programme I would
            say, that there is on "}" too many in the whole expression
            but simultaneously I know, that I am wrong.....???????????

 Keep hacking!
 mcc
 
  

Reply via email to