Hi,
I can't figure out where in the IDE to change the width of the tab stops. There is nothing under file-preferences for the editor that I can see? This seems crazy to me that 2 spaces, as a default, is good for anyone !?!?
Thanks!
Hi,
I can't figure out where in the IDE to change the width of the tab stops. There is nothing under file-preferences for the editor that I can see? This seems crazy to me that 2 spaces, as a default, is good for anyone !?!?
Thanks!
Hi @mottretop. There are two separate systems to configure:
I'll provide instructions you can follow to configure both these things to use your preferred number of spaces:
The editor behavior can be configured in Arduino IDE's advanced settings:
editor.tabSize in the "Search Settings" field of the "Preferences" tab.The sketch code can be automatically formatted to a standardized style by selecting Tools > Auto Format from the Arduino IDE menus. It is possible to define a custom formatter configuration.
The configuration system is documented in general here:
https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-customize-auto-formatter
The standardized formatter configuration file is available from the link in that tutorial. If you would like the formatter to use a different number of spaces, use that file, but change the value of the relevant properties.
For example, if you want an indent of 8 spaces, change this line:
IndentWidth: 2
To this:
IndentWidth: 8
Wow Thanks!
They couldn't have made that more difficult if they tried!!
The instructions under the "Auto Format" section are only required due to a bug in Arduino IDE:
Once that is fixed, the formatter will be automatically configured when you change the "Editor: Tab Size " setting.
If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject.