转自:https://blog.csdn.net/qq_37932863/article/details/73611785

《阿里巴巴java开发规范手册》时里面有一条:Eclipse设置tab键为四个空格

那么我们为什么要强制要求呢?

其实tab键默认占位8个字符,而我们用4个空格,也就是4个字符代替时,不仅缩小了我们书写代码的存储大小,也避免了代码移植时候产生的差异,而且看起来也很美观。

怎么设置呢?

打开eclipse-windows-preferences

Eclipse设置tab键为四个空格

这个是设置我们写代码时,用到的tab键,然后点apply

Eclipse设置tab键为四个空格

Eclipse设置tab键为四个空格

Eclipse设置tab键为四个空格

Eclipse设置tab键为四个空格

这个是设置我们格式化(ctrl+shift+f)时所包含的tab的格式

至此tab键4个空格全部设置完毕

相关文章:

  • 2022-12-23
  • 2021-05-22
  • 2021-05-21
  • 2021-09-23
  • 2022-03-05
  • 2021-05-15
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-01
  • 2021-04-08
  • 2021-10-04
相关资源
相似解决方案