Reputation: 1288
How can I hide the following lines to get a cleaner code view?
Like this in the official documentation:
How can I do that or find settings in the documentation?
Upvotes: 56
Views: 36085
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
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
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
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
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 File → Preferences → Settings.
In the search box, type "render indent guides" (without the ""
)
Untick the box which says "Controls whether the editor should render indent guides".
This removes the indent guides.
Upvotes: 22
Reputation: 222582
Go to
Menu File → Preferences → Settings
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
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.
To control the color of the active line, add...
"editorIndentGuide.activeBackground": "#444444b9" // Grey with some transparency.
Upvotes: 17