全局生效
设置tab长度:
{
"editor.detectIndentation": false,
"editor.tabSize": 2
}
项目生效
在项目文件中新建.editorconfig 文件
为特定类型文件指定缩进大小、缩进类型(空格,或tab),是否自动插入末行等等。
root = true
[*]
charset = utf-8
indent_style = tab //使用制表符
indent_size = 4 //4个空格为一个缩进
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true