Visual Studio 代码中的默认缩进线指南?

Default indent line guide in Visual Studio Code?

Visual Studio代码中是否有内置的缩进指南?

我们刚刚在 June 2016 release (v1.3.0) 中发布了这个。您可以通过将以下内容添加到您的 settings.json 文件来启用它 (F1, Open Settings (JSON)):

"editor.renderIndentGuides": true

对于更多可自定义的缩进指南,您将需要一个扩展,例如 Guides

September 2021 (version 1.61) 版本开始,现在正确的设置是:

"editor.guides.indentation": true

中的旧设置已被弃用:

Indentation guides settings

The editor.renderIndentGuides and editor.highlightActiveIndentGuide settings have been deprecated in favor of editor.guides.indentation and editor.guides.highlightActiveIndentation.

默认缩进行指南

  • 方法一(使用settings.json)

    "editor.renderIndentGuides": false, 现在 在 vs 中弃用 代码。

    改用"editor.guides.indentation": true

  • 方法二(使用设置UI)

    转到设置 > 搜索 editor.guides.indentation > 添加 'tip' 标记 用于指南缩进。


自定义缩进线指南

使用以下扩展,您可以添加自定义缩进指南

Extension