Go Down

Topic: Tabs instead of spaces (Read 7966 times) previous topic - next topic

Jeff009

Hello,

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:

editor.tabs.size=4

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?

Thanks,

Jeff

rockwallaby

#1
Aug 23, 2012, 12:00 am Last Edit: Sep 12, 2012, 09:14 am by rockwallaby Reason: 1
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.


rockwallaby....
Paul - VK7KPA

crait

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.

pYro_65

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.
Forum Mod anyone?
https://arduino.land/Moduino/

pert

#4
Aug 22, 2016, 03:17 am Last Edit: Aug 22, 2016, 03:17 am by pert
  • 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:

Code: [Select]
editor.tabs.expand=true
to:
Code: [Select]
editor.tabs.expand=false
  • Save and close preferences.txt
  • Start the Arduino IDE
  • Enjoy your real tabs(I much prefer spaces)

crait

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.

pert


Code: [Select]
indent=spaces=2
            with your preferred settings.
  • Save the file.
  • Restart the Arduino IDE if it's running.

Go Up