user246114
user246114

Reputation: 51681

Eclipse whitespaces for tabs

I'm using Galileo, and I've gone:

Preferences -> General -> Editors -> Text Editors -> Spaces for tabs

but the editor still inserts real tabs when I press the TAB key. This is driving me crazy. How do I force eclipse to put in spaces for tabs? I'm editing Java files.

Thanks

Upvotes: 6

Views: 2797

Answers (2)

bkritzer
bkritzer

Reputation: 1416

Go to Preferences -> Java -> Code Style -> Formatter. Click edit next to your active profile. Change your tab policy to Spaces Only

Upvotes: 2

Pascal MARTIN
Pascal MARTIN

Reputation: 401182

What about :

  • Window > Preferences > Java > Code Style > Formater
  • and, then, edit the formating style (it'll open another dialog)
  • In that new dialog :
    • General settings > Tab policy => choose "Spaces only", instead of "Tabs only"
    • You can also set the "Tab size".

Upvotes: 12

Related Questions