You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

如何修改VS Code缩进引导线以显示当前行的缩进起始位置?

How to Get Your Desired Indent Guide Behavior in VS Code

Absolutely, you can tweak VS Code's settings to make indent guides only appear for the active indent level (the one your cursor is currently in)—exactly matching what you’re looking for. Here’s how to do it:

  • Open your VS Code settings: Press Ctrl+, (Windows/Linux) or Cmd+, (Mac), or navigate to File > Preferences > Settings.
  • In the search bar, type editor.guides.indentation.
  • Toggle the setting to false. This hides all regular indent guides, leaving only the active ones (linked to your cursor’s current indent level) visible.

Alternatively, you can directly edit your settings.json file by adding this line:

"editor.guides.indentation": false

By default, VS Code already enables editor.guides.activeIndentation (which controls displaying the active level’s guides), so you won’t need to adjust that unless you’ve modified it previously.

With this setup, when your cursor is inside the <head> tag like in your example, only the indent guides for that inner level will show up. Parent levels like <html> and <body> won’t have any guides displayed—just like your desired outcome.

内容的提问来源于stack exchange,提问作者nj-gd

火山引擎 最新活动