设置Tab键为4个空格。

在阿里的Java开发手册 一、编程规约(三)代码格式 第5条提到

【强制】采用4个空格缩进,禁止使用tab字符。IDEA中勿勾选 Use tab character;eclipse中必选 insert spaces for tabs。


具体设置方法:

1、在eclipse中,Windows--Preference--General--Editors--Text Editors 勾选其中的 Insert spaces for tabs;点击Apply;
设置Tab键为4个空格 Java开发手册规范之tab键设置

2、接着进入Windows--Preference--Java--Code Style--Formatter 点击New...
3、输入名字点击ok后,在Tab policy选项中选择Spaces only,其中Indentation size即一个tab对应多少空格。

设置Tab键为4个空格 Java开发手册规范之tab键设置


Java开发手册:关注【阿里技术】微信公众号,回复 手册,即可获得最新 Java开发手册

设置Tab键为4个空格 Java开发手册规范之tab键设置

相关文章:

  • 2021-08-26
  • 2022-01-01
  • 2022-12-23
  • 2021-04-08
  • 2022-12-23
  • 2022-01-11
猜你喜欢
  • 2022-01-01
  • 2021-05-05
  • 2021-12-05
  • 2021-05-22
  • 2021-08-15
  • 2021-12-14
相关资源
相似解决方案