如何在Visual Studio代码资源管理器文件树结构中添加更多缩进?

如何在文件树结构中添加更多缩进?它有一点缩进,我想增加一点,就像NetBeans一样。

检查图像

enter image description here

57952 次浏览

转到文件比;偏好比;设置并选择:

Workbench›树:缩进

以像素为单位控制树缩进。

或(在您的设置。Json直接输入)

 "workbench.tree.indent": 10

选择一个足够高的数字。

也可以在垂直指南(自定义侧边栏)中看到我的答案,在v1.36中,您可以添加彩色树缩进指南,使资源管理器文件结构更加明显。

demo of explorer guidelines

示例图片在colorCustomizations中使用:"tree.indentGuidesStroke": "#00ff00",因此指导方针将显示为绿色。

{                                         // in settings.json
"workbench.colorCustomizations": {
"tree.indentGuidesStroke": "#00ff00"
}

在v1.64版本中有一个小变化,请注意最低树缩进将从之前的0提升到4。所以不能小于4。

{
"workbench.tree.indent": 20,  // just paste this line of code in setting.json file
"editor.mouseWheelZoom": true // for zoom in & out font size with Ctrl+ mouse scroll
}

对于Mac,使用你的菜单栏

Code > Preferences > Settings

然后在搜索设置中键入:tree或转到

Workbench > Appearance > Tree: Indent(以像素为单位控制树缩进)

并设置您首选的缩进

如果你只是想改变缩进,你可以设置这些选项:
按Ctrl+Shift+P ->进入首选项:打开设置(JSON)

"workbench.tree.indent": 18,

你也可以添加指导方针:

"workbench.tree.renderIndentGuides": "always",

你也可以使用以下方法改变它们的颜色:

"workbench.colorCustomizations": {
"tree.indentGuidesStroke": "#008070"
},

除了涉及设置文件的其他答案外,还可以在文件/偏好/设置 GUI中更改缩进:

enter image description here

截至Visual Studio Code版本:1.59.0+

你必须去:Code (on menu bar) > preferences > [user menu] > Appearance > tree:indent

我把它设置为22。

enter image description here