启动Eclipse,打开Preferences对话框。菜单“window”-“Preferences”。

找到Text Editors,勾选show whitespace characters,如图:

“General”-“Editors”-“Text Editors”

需要显示哪些空白,则可以点击“configure visibility”,如图所示

 

 

 导入方法:Eclipse->window->preferences->Java->Code Style->Formatter->Import 选择eclipse-java-google-style.xml文件。

点击apply,ok就行了。这样就可以选中代码进行格式化(默认快捷键是Ctrl+Shift+F),用以保持代码风格一致。

           默认的缩进是2格,一般习惯都是四格的缩进,可以在edit里面修改一下:

可以修改缩进和tab缩进。这样基本上就可以了。

相关文章:

  • 2021-09-03
  • 2021-06-27
  • 2021-08-06
  • 2021-08-06
  • 2021-08-13
  • 2021-08-13
猜你喜欢
  • 2022-12-23
  • 2021-12-18
  • 2021-10-26
  • 2021-12-22
相关资源
相似解决方案