vscode换行时自动缩进的问题

设置了缩进为2,但是换行时自动缩进还是4,格式化代码时alt+shift+f缩进也是4,设置如下:

{
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "editor.fontSize": 19,
    "editor.detectIndentation": false,
    "editor.insertSpaces": false,
    "editor.formatOnType":true,
    "editor.tabSize": 2,
    "files.autoSave": "onFocusChange",
    "git.ignoreMissingGitWarning": true,
    "[javascript]": {
      "editor.defaultFormatter": "vscode.typescript-language-features"
    },
    "eslint.autoFixOnSave": true,
    "editor.autoIndent": false,
}

请问要如何设置,才能让换行和格式化时缩进改为2?

阅读 17.9k
2 个回答

文件 首选项 设置 输入搜索 tabsize

clipboard.png

clipboard.png

点进去设为 "editor.detectIndentation": false,

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进