Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to auto-format code in Eclipse?

How do you auto-format code in Eclipse?

like image 446
HasanAboShally Avatar asked Mar 27 '13 09:03

HasanAboShally


People also ask

How can I get beautify code in Eclipse?

Go to Source | Format Document or press Ctrl+Shift+F.

How do I use code formatter XML in Eclipse?

All you need is to export settings from Eclipse (go to Eclipse's Preferences → Java → Code Style → Formatter and export the settings to an XML file via the Export All button.), and then open IntelliJ IDEA Settings → Code Style → Java, click Manage, and import that XML file by simply clicking Import.


1 Answers

On Windows and Linux : Ctrl + Shift + F

On Mac : + + F

(Alternatively you can press Format in Main Menu > Source)

like image 179
HasanAboShally Avatar answered Oct 22 '22 05:10

HasanAboShally