Skif
Skif

Reputation: 1288

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?

Upvotes: 56

Views: 36085

Answers (8)

Chocobo
Chocobo

Reputation: 69

The way show indent guides only for Active lines as of the current version:

Find your background hex color (found here if it's one of the defaults).

Then add the following to settings.json (example in default dark mode):

"workbench.colorCustomizations": {
    "editorIndentGuide.background1": "#1E1E1E",// Default background color.
    "editorIndentGuide.activeBackground1": "#707070"
    }

Upvotes: 0

Mehdi Faraji
Mehdi Faraji

Reputation: 3816

You can hide indent guide lines completely from settings.json.

Navigate to your settings.json by pressing cmd or ctrl + shift + P and type settings.json and press Enter.

Then paste the following code:

 "editor.guides.indentation": false,

Upvotes: -1

Phiter
Phiter

Reputation: 14992

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,

Upvotes: 61

dilshan
dilshan

Reputation: 2522

Method-1 (using settings.json)

"editor.renderIndentGuides": false, is now deprecated in vs code.

Use "editor.guides.indentation": false instead.


Method-2 (using settings UI)

Goto settings > search editor.guides.indentation > Remove 'tip' mark for guides indentation.

Upvotes: 10

Paul M
Paul M

Reputation: 505

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.

Upvotes: 22

Sajeetharan
Sajeetharan

Reputation: 222582

Go to

Menu FilePreferencesSettings

And search for "editor.folding". Set it to

"editor.folding": false

This will disable the lines and the folding function.

Since you want to disable the render indent guides,

From the documentation

  "editor.renderIndentGuides": false,

This will disable the indent guides.

Upvotes: 3

GollyJer
GollyJer

Reputation: 26672

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.

Upvotes: 17

Skif
Skif

Reputation: 1288

SOLVED: "editor.renderIndentGuides": false

Upvotes: 3

Related Questions