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

一般是直接Ctrl+Shift+F手动格式化,浪费时间。

其实Eclipse里已经带有自动格式化功能了,默认是没有打开该功能的。
具体方法:windows-->Preferences-->Java --> Editor-->Save Actions,

看到右边的选项了吧,勾选“Perform the selected actions on save”,其他选项根据需要自己选择或者配置就可以了。

 

转自:http://blog.csdn.net/zwhfyy/article/details/8512325

posted @ 2015-01-06 09:53  havery  阅读(105)  评论(0)    收藏  举报