Subject: RE: [hackers-il] YA Vim Trick: Indenting an Arbitrary Block

From: Omer Musaev <[email-masked]>
Date: Wed, 20 Feb 2002 10:26:10 +0200

> -----Original Message-----
> From: Shlomi Fish [mailto:[email-masked]]
> Sent: Wednesday, February 20, 2002 9:01 AM
> To: Hackers-IL
> Subject: [hackers-il] YA Vim Trick: Indenting an Arbitrary Block
> 
> 
> 
> I always had trouble indenting an arbitray block in Vim. The 
> best way I
> could find was to count the number of lines in the block (by 
> subtracting
> them - %-)) and then to use << or >>. Today, I was browsing 
> the help file
> trying to find a way to indent a selection, when I realized the
> following method was possible:
> 

What do you mean by "arbitrary block"? If I understand correctly 
you mean a block that is not surrounded by parents or by braces?

> 1. Go to the end of the block you wish to indent or unindent.
> 
> 2. Type "m" and then "e". This will set the mark "e" at the end of the
> block.
> 
> 3. Go to the beginning of the block.
> 
> 4. Type ">`e" to indent or "<`e" to un-indent.
> 
> A > or a < expects a motion to come next, and `[mark-letter] 
> goes to the
> next mark.
> 
> Vim (and possibly vi in general) is so obscure, that one discovers new
> ways to do things more efficiently all the time. But I am fond of
> technologies that I gradually learn new things in them, so it's OK.
> 

> Regards,
> 
> 	Shlomi Fish
> 
> 
> ----------------------------------------------------------------------
> Shlomi Fish        [email-masked]
> Home Page:         http://t2.technion.ac.il/~shlomif/
> Home E-mail:       [email-masked]
> 
> "Let's suppose you have a table with 2^n cups..."
> "Wait a second - is n a natural number?"
> 
> 
> ------------------------ Yahoo! Groups Sponsor 
> ---------------------~-->
> Sponsored by VeriSign - The Value of Trust
> Pinpoint the right security solution for your company - FREE
> Guide from industry leader VeriSign gives you all the facts.
> http://us.click.yahoo.com/pCuuSA/WdiDAA/yigFAA/saFolB/TM
> --------------------------------------------------------------
> -------~->
> 
> To unsubscribe from this group, send an email to:
> [email-masked]
> 
>  
> 
> Your use of Yahoo! Groups is subject to 
http://docs.yahoo.com/info/terms/

---

From: Shlomi Fish <[email-masked]>
Date: Wed, 20 Feb 2002 11:35:18 +0200 (IST)

> you mean a block that is not surrounded by parents or by braces?

Indeed. I mean a block that can be lines xxx to yyy where xxx and yyy are
any arbitrary numbers.

Regards,

	Shlomi Fish