I'm trying to configure the IDE Editor, to use 4 spaces instead of 2. I was able to configure version 1 of the IDE changing preferences.txt (editor.tabs.size=4), and formatter.conf (indent=spaces=4). But I cannot find those configuration nor anything similar con Arduino IDE 2 (beta).
I'll provide instructions you can follow to configure both these things to use your preferred number of spaces:
Editor
The editor behavior can be configured in Arduino IDE's advanced settings:
Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
A menu will appear on the editor toolbar:
Select the "Preferences: Open Settings (UI)" command from the menu. ⓘ You can scroll down through the list of commands to find it or type the name in the field.
A "Preferences" tab will open in the Arduino IDE main panel.
Type editor.tabSize in the "Search Settings" field of the "Preferences" tab.
Set the field under the "Editor: Tab Size" setting to your preferred number of spaces.
Close the Preferences tab by clicking its X icon.
Auto Format
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:
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 4 spaces, change this line: