
打开Preferences

勾选General下的Editors下的Text Editors中的Insert spaces for tabs

打开Java下的Code Style下的Formatter,点击Edit,新建一种profile

选择Tab policy:为Spaces only
保存退出
之后格式化之前的代码,如果是保存自动格式化的,随便添加一个字符,保存,再将该字符删掉,发现Tab键已经变为4个空格了,SHIFT+Tab键仍然好用
本文介绍如何在IntelliJ IDEA中将Tab键设置为插入4个空格,包括在Preferences中调整General、Editors、TextEditors及Java CodeStyle Formatter的详细步骤。

打开Preferences

勾选General下的Editors下的Text Editors中的Insert spaces for tabs

打开Java下的Code Style下的Formatter,点击Edit,新建一种profile

选择Tab policy:为Spaces only
保存退出
之后格式化之前的代码,如果是保存自动格式化的,随便添加一个字符,保存,再将该字符删掉,发现Tab键已经变为4个空格了,SHIFT+Tab键仍然好用

被折叠的 条评论
为什么被折叠?
