Formatting Files for IDEs
To install it go through the following steps:
Copy the settings XML file to the code styles directory. Its location is platform dependent, and is listed below. Please note that you need to replace <product-name> with the name and version of IDEA you use.
Mac OS X:
In the Preferences go to "Editor" - "Code Style" - "Scheme" and choose the previously imported style from the drop-down box
Optionally apply the style to one project only by clicking on "Copy to Project" and selecting "Use per project settings" afterwards
In Idea >= 10, use File -> Export/Import settings. This will allow you to select/deselect from many categories of settings (including code style).
Important: you still need to configure to use spaces instead of tabs.
Important: Eclipse formatting rules don't incorporate package import order or when wildcard importing should be used. See imports section below how it should be configured manually.
The Eclipse formatting file is not actively maintained and may not be up-to-date.
Formatting for Specific Languages
- Java Code Formatting
- JSP Code Formatting
- XML Code Formatting