Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I tried to change the width of indentation of my Eclipse IDE to 2 via Preferences -> General -> Editors -> Text Editors -> Displayed Tab Width.

However, when I press tab or shift + tab, I still indent or un-indent by 4 spaces. Why? This still occurs even after restarting Eclipse.

share|improve this question
up vote 4 down vote accepted

If you search in preferences for the code formatter, I think you will find what you're looking for. It should be located under: Java > Code Style > Formatter

There should be a tab labeled Indentation with the settings which you seek to tweak.

enter image description here

Also, see here for how to set up the formatter to auto-format your code with Ctrl+Shift+F.

share|improve this answer
I've set up the formatter to do 4 spaces as you've shown here and in the link at the bottom. When I run teh auto formatter, it still changes everything to use 2 spaces instead of 4. – Stealth Rabbi Dec 7 '15 at 15:16
Happy new year @StealthRabbi! Are you trying to get 4 spaces or a single tab (with the size of 4 spaces like what is shown)? If it's not taking, you can try renaming the profile and then re-applying the formatting. – rishimaharaj Jan 5 at 17:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.