Vscode 给不同文件定义不同缩进

10/31/2021 vscode

有时候Vscode 同时导入了多种项目,比如java和angular,就需要对它们进行不同方式缩进设置。

  • 安装EditorConfig 插件
  • 在工作空间根目录新建.editorconfig文件
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
quote_type = single

[*.java]
indent_style = space
indent_size = 4
editor.tabSize = 4

[*.md]
max_line_length = off
trim_trailing_whitespace = false
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Last Updated: 12/26/2022, 11:54:10 AM