Format your code with only one button press! This plugin makes use of external formatprograms to achieve the best result. Check the list of formatprograms to see which languages are supported by default. You can easily customize or add your own formatprogram.

Go to the repository page https://github.com/Chiel92/vim-autoformat .
That's where the code lives, and that's where you will find installing details.
That being said, I may upload a new README.md when there have been major changes, just to notify the visitors of vim.org.

User defined options, such as shiftwidth and expandtab are taken into account.
More specifically:
- The options expandtab, shiftwidth, tabstop and softtabstop are not overwritten anymore.
- This obsoletes g:autoformat_no_default_shiftwidth.
- g:formatprg_args_expr_<filetype> is introduced, for dynamically defining formatprg arguments.

* Customization of formatprograms can be done easily now, as explained above.
* I set the default tabwidth to 4 for all formatprograms as well as for vim itself.
* The default parameters for astyle have been slightly modified: it will wrap spaces around operators.
* phpCB has been removed from the defaults, due to code-breaking behaviour.
* XHTML default definition added
* When no formatter is installed or defined, vim will now auto-indent the file instead. This uses the indentfile for that specific filetype.