[笔记] eclipse 代码格式化


1. 优化格式化 html/jsp 时的格式

eclipse默认格式化html/jsp的样式非常恶心,需要调整一下.
window-->preferences-->Web-->HTML Files-->Editor,
将Line width设置为720,使代码不会很容易换行,
然后在Inline Elements中选中第一个拖动滚动条到底部按着Shift点击最后一项,点击Remove,将所有的Inline Element移除,如下图

小技巧: 如果在格式化html的时候不想把html文件中的css和js搞乱了,可以点击单击body,左侧淡蓝色区域出现后再格式化.


2. 优化格式化 css 时的格式

window-->preferences-->Web-->CSS Files-->Editor,

另外这个帖子也不错: http://blog.csdn.net/y151706928/article/details/52884562