Code Style

Window->Prefrerence->Java->Code Style->Formatter

  • 这个根据自己需要调整

保存时行为

Window->Prefrerence->Java->Editor->Save Actions

  • 首先激活“Perform the selected actions on save”
  • 仅仅选择"Organize imports"和"Additional actions"
  • 点击“Configure”,打开新的对话框

    • Code Organizing -> Remove trailing whitespaces -> All lines
    • Code Style -> Variable declarations -> 全部选中
    • Missing Code -> 去掉对'@Deprecated'的选择
    • 点击OK

显式地显示空白字符

Window->Preferences->General->Editors->Text Editors->Show whitespace characters

用space代替tab

  1. Window -> Preferences -> XML -> XML Files -> Editor,选择Indent using spaces,然后indentation size选择4

  2. Window -> Preferences -> General -> Editors -> Text Editors,选择Insert spaces for tabs,Displayed tab width选择4

编码,Windows需特别注意

Window -> Preferences -> General -> Workspace -> Text file encoding,选择Other -> UTF-8


wangdai
1k 声望18 粉丝

引用和评论

0 条评论