Dec 21, 2021

Arduino IDE: setting tab indent to another value

Change default tab setting to four (4) spaces in IDE (applies to version 1.6.10 and later.)

Steps:

  1. Exit Arduino IDE. (otherwise the closing of application will overwrite preferences file.)

  2. Edit preferences.txt on two lines:

  3. editor.tabs.expand=true

    editor.tabs.size=4

    Save and exit.

  4. Create new file:

    • formatter.conf

    in your Arduino directory (in the same location as preferences.txt)

    • in windows: 
      C:\Program Files (x86)\Arduino\lib = C:\Users\{USRNAME}\AppData\Local\Arduino15

    • on mac: it's /Users/{USRNAME}/Library/Arduino15/

      Add this one line:

      indent=spaces=4
  5. Then save and relaunch.

     Tabbing and auto-formatting (^t) will indent consistently.



    References:

    Information source: (https://github.com/arduino/Arduino/issues/5012)

No comments: