Eclipse 格式化代碼時不換行與自動換行的實現方法

  1. preferences->Java->Code Style->Code Formatter->Show... ,打開以後,選擇「Line Wrapping」選項卡,在「Maximun line width」指定大於多少列時換行。
  2. 仍是在「Line Wrapping」選項卡中,能過選擇"Line Wrapping policy"能夠指定構造函數、方法體等的換行狀況。 不過,SUN推薦的編碼風格默認是80列換行。
Java代碼

打開Eclipse的Window菜單,而後Preferences->Java->Code Style->Formatter->Edit/Show(根據不一樣版本可用的按鈕會不同) ->Line Wrapping->Maximum line width:由80改爲800就好了。app

Html代碼

Window->Preferences->MyEclipse->Files and Editors->Html->Html Source->Line width->加個0之後保存。函數

相關文章
相關標籤/搜索