eclipse中xml文件格式化

  eclipse中xml文件格式化(ctrl+shift+f),可能会发现格式化xml文件后很乱,如图:

这不是我想要的样子,我想要的是这样的:

 

解决办法:windows -> Perferences ->XML -> XML Files ->Editor

     Line Width:设置每行字符数

     Split multiple attributes each on a new line:标签属性单独一行显示

  一般,行字符数根据需要设置。然后去除标签单独显示复选框即可。

原文地址:https://www.cnblogs.com/eric-fang/p/5431417.html