On 9/13/06, Gundala Viswanath <[EMAIL PROTECTED]> wrote:
Dear Tony and all,
>
> My Linux box indeed hasn't got "cb", but it has got "indent" which is
> meant to beautify and reformat C code, e.g. by adding and removing
> spaces, tabs, linefeeds and blank lines, according to various parameters
> on a command-line and/or in a config file; GNU indent supports
> "original", "K&R" and "GNU" styles in addition to custom style. See
> "info indent" (where installed) for details.
>
Thanks all, glad to know gnu indent
is already there. It is the closest thing to perltidy.
What is your favorite options for "indent" Tony.
Second thing is that whenever I do:
:'<,'>!indent -kr
of a particular block. After the formatting,
it pushes the block to the first column, in the vi editor.
Is there a way to maintain the current position
of the block with indent?
I'm afraid only vim internal indenter can be used for partial(block) tidying.
External indenter can be used only for full-file tidying.
That's because external indenter is given only the block
and it doesn't know the surrounding context.
External indenter is thus useless for partial(block) tidying.
The vim builtin indenter known about surrounding context
and can properly indent both blocks and the whole file.
Yakov