How can I indent a file using vim?

I recently read this article related to indenting source files in Vim. However, I would like some of them to have custom indentation. Is there any way to indicate which binary runs when pressing =?

+5
source share
2 answers

Through:

= {motion} Filter {motion} lines through the external program
                given with the 'equalprg' option. When the 'equalprg'
                option is empty (this is the default), use the
                internal formatting function | C-indenting |. But when
                'indentexpr' is not empty, it will be used instead
                | indent-expression |.

It seems that customization equalprgis what you want.

+7
source

You can set equalprg-option. (see: he = for more).

+3
source

All Articles