62

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?

5
  • you want to collapse that lines ??? Commented Mar 13, 2018 at 12:15
  • just hide. I want to get more clean code view. Like this view in official documentation (prntscr.com/iqkmtz) Commented Mar 13, 2018 at 12:15
  • See here: code.visualstudio.com/docs/getstarted/keybindings, then look for Fold (collapse) Commented Mar 13, 2018 at 12:18
  • Sorry for my language. I mean indent guides. Commented Mar 13, 2018 at 12:42
  • check the answer :) updated Commented Mar 13, 2018 at 13:17

8 Answers 8

66

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,
Sign up to request clarification or add additional context in comments.

4 Comments

You can also reach this file navigating to File -> Preferences - > Settings as Sajeetharan mentioned in his answer.
I have updated my answer just so it's according to the real problem faced by OP.
editor.renderIndentGuides has been deprecated in favor of editor.guides.indentation in version 1.6.1.
@Darren - very useful information, though it's version 1.61 (not 1.6.1). While the deprecated setting does still work (as of 1.67), it is no longer documented (so if you follow the link in the answer, you won't find it) and, even more importantly, it doesn't work in the per-language settings (but the new setting does).
25

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.

2 Comments

this is the real answer... code folding + no indent lines.
If you also want to get rid of dots which appear after "deselecting render indent guides", change the "Render Whitespaces" setting to none.
17

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.

1 Comment

I like it. Slightly out-of-the-box approach that doesn't do exactly what was asked for (even after clarification), but might be even better, depending on your tastes.
10

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.

1 Comment

We should really vote this answer up so that it becomes the top answer. Besides simply being newer and not deprecated, editor.guides.indentation can be used as a per-language setting, while the deprecated one can't.
3

SOLVED: "editor.renderIndentGuides": false

4 Comments

Ohh, you said code folding, so I tought you meant the collapse buttons.
dude your question and answer are totally different
@Sajeetharan Sorry for my language.
Please consider accepting @Begula's answer so that it gets the checkmark and is listed above answers that are now obsolete.
3

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.

Comments

0

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"
    }

Comments

-1

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,

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.