vi and code beautify

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Vic DeValmont
Date:  
Subject: vi and code beautify
I do that with vim.

Ctl+v
highlight the block
Shift + I
[Tab]
[ESC]

On Friday 16 November 2001 10:06 pm, you wrote:
> moin, moin,
>
> do any of the vi clones have a way to re-indent code?
>
> I know emacs has something, but have only used it once or twice.
>
> I want to be able to automagically reindent a block.
>
> Say I add an if statement, I want to automagically be able to toss
> everything that it now surrounds in one more tab.
>
> e.g.:
>
> if ( $fred ) {
> &do_the_fred;
> }
>
> becomes:
>
> if ( $fred ) {
>     &do_the_fred;
> }

>
> This hopefully works for multiple languages. I'll worry about particulars
> such as brace placement after I have something already working :).
>
> ciao,
>
> der.hans