Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse whitespaces for tabs

Tags:

eclipse

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

like image 951
user246114 Avatar asked Feb 23 '10 17:02

user246114


2 Answers

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".
like image 173
Pascal MARTIN Avatar answered Sep 21 '22 12:09

Pascal MARTIN


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

like image 45
bkritzer Avatar answered Sep 22 '22 12:09

bkritzer