Editor Modification

My 77-year-old eyes don't work as well as they used to. I prefer to use a tab size of 4, and have changed the preferences to do that. However, after working on a sketch, when I need to clean the code up using Auto Format in the tools. Unfortunately it reformats with a tab size of 2. What file do I need to edit to either read that from the preferences file, or just simply hard code it? Any help would be appreciated.

Inside the Arduino IDE installation folder in the lib subfolder there is a file named formatter.conf. Open that file in a text editor and change the value of the line that starts with indent=spaces=.

Thank you for the prompt reply; that should solve my problem.

I'm glad if I was able to help. I forgot to say you need to restart the Arduino IDE before the change will take effect.

The other thing to note is that, even though your changes to preferences.txt will persist, you will need to redo this changes to formatter.conf every time you update to a new version of the Arduino IDE.

Another option might be to use an external editor - there is an option for that in Preferences. I do all my editing using Geany

If you select "external editor" in Preferences you can use any editor you like and the IDE will recognize that the editor has altered the file when you try to compile or upload.

...R