Tabs instead of spaces


I'd like my Arduino IDE to use spaces instead of tabs. I've modified my preferences.txt file (I'm running under 64-bit Win7 Pro BTW, it it matters) and I've set:


Indentation is now set to 4 spaces. What I'd like to do now is to use tabs instead of spaces. Ho do I set up the IDE to use tabs?



I would like to second this request. I have been wishing this for a long time and would have thought that this would be thought of earlier on.

It is the reason I mostly used the external editor, gEdit on both linux and OSX, so my code can stay neat and more readable.


So, this topic was made in 2012 and it looks like the Arduino IDE hasn't been fixed yet. Is the tab button still broken or what? I can't seem to make tabs work. Instead, the IDE replaces the tab with spaces, which is retarded.

It is done like this so copying code to the forum (or GitHub) formats correctly. It used to bother me, but now I do not really care.

  • File > Preferences > More preferences can be edited directly in the file:(click on the path shown on the next line)
  • Close the Arduino IDE
  • Open the file preferences.txt in a text editor
  • Change the line:


  • Save and close preferences.txt
  • Start the Arduino IDE
  • Enjoy your real tabs(I much prefer spaces)

Thanks, pert! I appreciate that! I tried to do that earlier today and nothing changed. I retried about three or so more times (with the IDE closed) and it finally stuck and now I have actual tabspaces.

Unfortunately, auto-format still changes everything back to spaces.


with your preferred settings.

  • Save the file.
  • Restart the Arduino IDE if it's running.