Eclipse保存代码自动格式化
首先放xml下载地址 https://share.weiyun.com/5i2UH8H (密码:Zk6g)
废话不多说 直接上图
一.设置XML格式化模板
java文件,打开eclipse-->“window”--->“preferences”--->“java”-->“Code Style”-->“Formater”,选择写好的模板.xml文件导入即可。
二.设置保存时自动格式化代码
打开eclipse,选择 window-->Preferences-->JAVA-->Editor-->Save Actions。右边选中:Perform the selected actions on save、Format source code、Format all lines、Organize imports,保存后重启eclipse即可看到效果,操作步骤看下图:
ojbk完事!!!!