在vscode中修改python的tab size

在vscode内置的设置界面CTRL+,中似乎无法针对语言单独设置,我们可以直接编辑"$ENV:APPDATA\Code\User\settings.json"

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"git.autofetch": true,
"[python]": {
"editor.tabSize": 4,
"editor.indentSize": 4,
"editor.defaultFormatter": "ms-python.autopep8"
},
"editor.tabSize": 2,
"notebook.editorOptionsCustomizations": {
"editor.tabSize": 4,
"editor.indentSize": 4,
"editor.insertSpaces": false
}
}

使用"[python]"即可单独设置python文件。