Editor 如何在Visual Studio Mac代码上配置插入空格而不是选项卡

Editor 如何在Visual Studio Mac代码上配置插入空格而不是选项卡,editor,Editor,我开始使用VisualStudio代码。当前版本为0.3.0。 默认情况下,为制表符插入缩进。 但我想插入4个空格,而不是制表符。 我在首选项中找不到配置项。 请告诉我,如何配置插入选项卡或空间。您要查找的是keybindings.json。从菜单编码->首选项->键盘快捷键 在右侧窗格中,可以放置密钥绑定,例如: {"key": "ctrl+t", "when": "editorTextFocus", "command": "editor.action.tab"} 尽管您可能更喜欢

我开始使用VisualStudio代码。当前版本为0.3.0。
默认情况下,为制表符插入缩进。
但我想插入4个空格,而不是制表符。

我在首选项中找不到配置项。


请告诉我,如何配置插入选项卡或空间。
您要查找的是keybindings.json。从菜单编码->首选项->键盘快捷键

在右侧窗格中,可以放置密钥绑定,例如:

{"key": "ctrl+t",      "when": "editorTextFocus", "command": "editor.action.tab"}
尽管您可能更喜欢以下内容:

{"key": "ctrl+t",      "when": "editorTextFocus", "command": "    "}
问题是它没有像文档中所说的那样工作
见:


Microsoft已收到有关行为的通知,并且还请求了选项卡处理首选项。

大约从0.9.0版开始,通过修改设置.json文件中的以下参数,可以轻松访问此配置:

// Controls the rendering size of tabs in characters. Accepted values: "auto", 2, 4, 6, etc. If set to "auto", the value will be guessed when a file is opened.
"editor.tabSize": 4,

// Controls if the editor will insert spaces for tabs. Accepted values:  "auto", true, false. If set to "auto", the value will be guessed when a file is opened.
"editor.insertSpaces": true

有关其他设置和信息,请访问VS代码部分

谢谢你的回答。我希望微软下一次更新。