From: "A.J.Mechelynck" <[EMAIL PROTECTED]>
Subject: Re: Commenting out TeX-text line by line in V-mode
Date: Thu, 16 Nov 2006 05:20:13 +0100

> Meino Christian Cramer wrote:
> > Hi,
> > 
> >  a question more driven by curiosity than by the need to change
> >  anything.
> > 
> >  
> >  Suppose you have the following TeX-text:
> > 
> >     bla blabla foo bar gnu gnats bla blabla foo bar gnu gnats bla blabla
> >     foo bar gnu gnats 
> >     bla blabla foo bar gnu gnats 
> >     
> >     bla blabla foo bar gnu gnats bla blabla foo bar gnu gnats bla blabla
> >     foo bar gnu gnats 
> >     
> >     bla blabla foo bar gnu gnats 
> > 
> > 
> >  and because this text is so fullfilled with wisdom and knowledge,
> >  that no one else than you will be able to handle its contents
> >  carefully ;) you decide to comment it out to not to harm the public.
> >  As a vim newbie I would do that using block oriented visual mode on
> >  the first line and I-nserting a '%' (TeX's comment sign), which
> >  results in:
> > 
> >  %  bla blabla foo bar gnu gnats bla blabla foo bar gnu gnats bla blabla
> >  %  foo bar gnu gnats 
> >  %  bla blabla foo bar gnu gnats 
> >  %  
> >  %  bla blabla foo bar gnu gnats bla blabla foo bar gnu gnats bla blabla
> >  %  foo bar gnu gnats 
> >  %  
> >  %  bla blabla foo bar gnu gnats 
> > 
> > 
> >  So far so nice...it works.
> > 
> >  But would be there a way to acchieve the following commenting:
> > 
> >  %  bla blabla foo bar gnu gnats bla blabla foo bar gnu gnats bla blabla
> >  %  foo bar gnu gnats 
> >  %  bla blabla foo bar gnu gnats 
> >    
> >  %  bla blabla foo bar gnu gnats bla blabla foo bar gnu gnats bla blabla
> >  %  foo bar gnu gnats 
> >    
> >  %  bla blabla foo bar gnu gnats 
> > 
> >  (blank lines not commented out) by a similiar simple command like
> >  CTRL-v SHIFT-i <text><ESC> ?
> > 
> >  As said: This Q is mostly curiosity - based...I even dont know,
> >  whether haveing such a feature would be really useful or not.
> > 
> >  But as always: Experimenting is fun! :O)
> > 
> >  Keep editing!
> >  mcc
> >  
> > 
> 
> 1. Add all percent signs like you did above, even before blank lines.
> 2. Replace empty comments by blank (i.e. empty) lines as follows:
> 
>       :%s/^%\s*$//
> 
> 
> Best regards,
> Tony.
> 

Hi Tony,

 yes...I know that (which is an exception... ;)

 I thought there would be one command to achieve the same effect
 instead of """doing it the wrong way""" first and the """correct
 it""" by an additional command...

 Keep editing!
 mcc

Reply via email to