【发布时间】:2016-06-14 22:57:23
【问题描述】:
Visual Studio Code 中有内置的缩进指南吗?
【问题讨论】:
-
对于常规 VS 2017:stackoverflow.com/questions/42736094/…
标签: visual-studio-code vscode-settings
Visual Studio Code 中有内置的缩进指南吗?
【问题讨论】:
标签: visual-studio-code vscode-settings
我们刚刚在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
the other answer 的旧设置已被弃用:
缩进引导设置
editor.renderIndentGuides和editor.highlightActiveIndentGuide设置已被弃用,取而代之的是editor.guides.indentation和editor.guides.highlightActiveIndentation。
【讨论】:
默认缩进引导线
方法一(使用 settings.json)
"editor.renderIndentGuides": false, 现在在 vs 中弃用
代码。
请改用"editor.guides.indentation": true。
方法 2(使用设置 UI)
转到设置 > 搜索 editor.guides.indentation > 添加“提示”标记
用于指南缩进。
自定义缩进线指南
使用以下扩展,您可以添加自定义缩进指南
【讨论】: