Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I reindent all my codes in Eclipse?

Tags:

In most of the IDEs, I had a Reindent All command. How do I do that in Eclipse 1.2?

Edit: The commands work with Java codes but is there a way I can get it to work with Clojure?

like image 314
unj2 Avatar asked Jul 30 '09 15:07

unj2


People also ask

What does Ctrl Shift F do in Eclipse?

Show activity on this post. Ctrl + Shift + F formats the selected line(s) or the whole source code if you haven't selected any line(s) as per the formatter specified in your Eclipse, while Ctrl + I gives proper indent to the selected line(s) or the current line if you haven't selected any line(s).

How do I rearrange codes in Eclipse?

Open the required file. Go to Source | Format Document or press Ctrl+Shift+F.


2 Answers

Ctrl+Shift+F

will format all your code according to active formatting rules, this includes any indentation rules you defined (tabs/spaces, amount of those, etc...)

You can change those rules at:

  • Window > Preferences
  • Java > Code Style > Formatter
like image 147
Yuval Adam Avatar answered Sep 28 '22 09:09

Yuval Adam


Is CRTL+SHIFT+F working in eclipse 1.2 ? In 3.5 is working fine.

You can also select all the code you want to indent, and then hit CTRL + I

like image 35
Antoine Claval Avatar answered Sep 28 '22 09:09

Antoine Claval