Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I hide indent guides in Visual Studio Code?

How can I hide the following lines to get a cleaner code view?

Enter image description here

Like this in the official documentation:

Enter image description here

How can I do that or find settings in the documentation?

like image 253
Skif Avatar asked Mar 13 '18 12:03

Skif


3 Answers

Press Ctrl + Shift + p, type settings and select Preferences: Open Settings (JSON) to open User Settings, and add this:

// Controls whether the editor should render indent guides
  "editor.renderIndentGuides": false,

This will disable the indent guides.

See the documentation for User Settings.

Edit: as on 30th May, 2022, this setting is called

  "editor.guides.indentation": false,
like image 98
Phiter Avatar answered Nov 11 '22 12:11

Phiter


I tried the previous answers, but it would not let me, as it said the file was read-only, so the solution I found was below:

Click on menu FilePreferencesSettings.

In the search box, type "render indent guides" (without the "")

Untick the box which says "Controls whether the editor should render indent guides".

enter image description here

This removes the indent guides.

like image 32
Paul M Avatar answered Nov 11 '22 14:11

Paul M


Here's a way to hide the indent lines but keep the active line indicator.

Add this to settings.json.

"workbench.colorCustomizations": {
  "editorIndentGuide.background": "#00000000" // hide via 100% transparency.
}

Only the active indent block will be visible. only active guide showing

To control the color of the active line, add...

"editorIndentGuide.activeBackground": "#444444b9" // Grey with some transparency.
like image 14
GollyJer Avatar answered Nov 11 '22 12:11

GollyJer