vi and code beautify

Vic DeValmont plug-discuss@lists.PLUG.phoenix.az.us
Fri, 16 Nov 2001 20:22:17 -0500


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