format code in Eclipse?

你如何在Eclipse中自动格式化代码?


On Windows : Ctrl + Shift + F

On Mac : ⌘ + ⇧ + F

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


Another option is to go to Window->Preferences->Java->Editor->SaveActions and check the Format source code option. Then your source code will be formatted truly automatically each time you save it.


CTRL + SHIFT + F将自动格式化您的代码(无论是突出显示还是非突出显示)。

链接地址: http://www.djcxy.com/p/25444.html

上一篇: 自定义缩进规则

下一篇: Eclipse中的格式化代码?