Skip to content

Arduino IDE Auto Format configuration

per1234 edited this page Jun 4, 2018 · 2 revisions

The Arduino IDE uses Artistic Style or A Style to format code. The default configuration file is called "formatter.conf" and this file can be found in: Arduino/build/shared/lib/formatter.conf

It is recommended that in order to change the preferences in the auto formatter, a user should copy the formatter.conf file in the same folder of the file "preferences.txt" and modify the copy. This is done so the user does not lose their custom formatting when rebuilding Arduino.

The options in A Style include:

Indent spacing Indent classes, switches, and comments Space around operators Space after loops and conditional statements One liners

Changing the preferences.txt file does not edit the auto formatter and if the auto formatter is selected, the settings under preferences will be ignored.