-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Arduino IDE Auto Format configuration
The Arduino IDE's Tools > Auto Format feature uses Artistic Style to automatically format sketch code.
Artistic Style is configurable according to your formatting style preferences. The default configuration file is located at {Arduino IDE installation folder}/build/shared/lib/formatter.conf
.
Artistic Style configuration options are documented at http://astyle.sourceforge.net/astyle.html. However, that documentation is for the latest release of Artistic Style and Arduino uses an outdated version of Artistic Style (2.05.1) so not all the options documented on that page are usable. You can find version-specific documentation in the doc
folder of the Artistic Style downloads at this page: https://sourceforge.net/projects/astyle/files/astyle/.
To customize the Auto Format settings:
- Open
{Arduino IDE installation folder}/build/shared/lib/formatter.conf
in a text editor. - Add/remove/change settings.
- Save the file to the folder listed in the Arduino IDE on the line following File > Preferences > More preferences can be edited directly in the file. This is done so your changes will persist through updates of the Arduino IDE.
- Restart the Arduino IDE in order for your changes to take effect.