Eclipse 保存文件时自动格式化代码

很多同学不知道Eclipse有个很有用的功能,就是自动格式源代码的功能,一般大家都是直接Ctrl+Shift+F手动格式化,多浪费时间。

其实Eclipse里已经带有自动格式化功能了,默认是没有代开该功能的。
具体方法:windows-->Preferences-->Java --> Editor-->Save Actions, 看到右边的选项了吧,勾选“Perform the selected actions on save”,其他选项根据需要自己选择或者配置就可以了。

呵呵  别忘了,最后Apply和Ok一下。

posted @ 2012-12-27 10:19  rui90102  阅读(25957)  评论(1编辑  收藏  举报