Visual Studio Code - Hide Git Changes [duplicate] - visual-studio-code

In VS Code, if there's version control in a folder you're working in, it will try and indicate what lines are new and what lines are changed with little color patches in the "gutter" section. Actually, both on the left side near the line numbers, and also on the right side in the scroll bar. Is there a way to turn that off?

It is possible to change it in settings.json Ctrl+,
"scm.diffDecorations": "all" | "gutter" | "overview" | "none"
Or you can make them transparent:
"workbench.colorCustomizations": {
// Gutter indicators (left)
"editorGutter.modifiedBackground": "#0000",
"editorGutter.addedBackground": "#0000",
"editorGutter.deletedBackground": "#0000",
// Scrollbar indicators (right)
"editorOverviewRuler.addedForeground": "#0000",
"editorOverviewRuler.modifiedForeground": "#0000",
"editorOverviewRuler.deletedForeground": "#0000"
}

Just go to Settings and search for "Scm Diff Decorations" and set to none.

Go to File> Preferences> Settings> Features> SCM.
Shortcut: [ Ctrl ][ Shift ][ P ] > Preferences: Open User Settings> Features> SCM.
Set Diff Decorations to none.
Note that setting other options like the Gutter options shown below may remove some parts of it, but may leave the little red arrow while setting the Diff Decorations option to none will remove everything.

Look under Settings -> Features -> SCM -> Diff Decorations and set to none

If you arrived here, wanting to turn this feature off because you kept clicking on the SCM gutter bars by accident and accidentally opening the diff when you don't want to, this may be of value to you.
As an alternative to turning this useful feature off, consider setting the "SCM: Diff Decorations Gutter Action" instead. This setting controls what happens when you click on the gutter bars; setting to "none" prevents them from being clickable. This allows you to keep the visual information they provide while getting rid of the unwanted behavior.
"scm.diffDecorationsGutterAction": "none", // suppress opening diffs in margin ("gutters")

In Visual Studio 2022 Under Tools --> Options --> Text Editor --> General --> Remove tick from Track changes.

Related

How to get vscode to have more indent spaces in the folder hierarchy structure on the left side panel? [duplicate]

How to add more indentation in a file tree structure? It has a little bit indentation I want to increase more just like NetBeans.
check the image
Go to File > Preference > Settings and choose:
Workbench › Tree: Indent
Controls tree indentation in pixels.
or (in your settings.json enter this directly)
"workbench.tree.indent": 10
and choose a high enough number for you.
Also see my answer at Visual Studio code sidebar Vertical guideline (customize sidebar) where with v1.36 you can add colorized tree indent guides to make the explorer file structure more obvious.
The example picture uses: "tree.indentGuidesStroke": "#00ff00" in the colorCustomizations, so the guidelines will appear green.
{ // in settings.json
"workbench.colorCustomizations": {
"tree.indentGuidesStroke": "#00ff00"
}
In a small change coming to v1.64 note that the minimum tree indent will be raised to 4 from 0 previously. So you will not be able to go less than 4.
If you just want to change the indentation you can set these options:
Press Ctrl+Shift+P -> Go to Preferences: Open Settings (JSON)
"workbench.tree.indent": 18,
You can add guidelines as well with:
"workbench.tree.renderIndentGuides": "always",
You can also change their color using:
"workbench.colorCustomizations": {
"tree.indentGuidesStroke": "#008070"
},
For Mac, using your menu bar would be
Code > Preferences > Settings
Then at the Search settings type: tree or go to
Workbench > Appearance > Tree: Indent (Controls tree indentation in pixels)
and set your preferred indentation
{
"workbench.tree.indent": 20, // just paste this line of code in setting.json file
"editor.mouseWheelZoom": true // for zoom in & out font size with Ctrl+ mouse scroll
}
As of Visual Studio Code Version: 1.59.0+
You have to go: Code (on menu bar) > preferences > [user menu] > Appearance > tree:indent
I set it to 22.
Besides the other answers involving settings files, the indentation may also be changed in the Files / Preferences / Settings GUI:

How to hide dashes on right sidebar in VS Code?

I want to get rid off these dashes on right scrollbar of the editor
It's like minimap to indicate the current highlightings in editor.
Update:
I think this feature is Bar mode But still I don't know how to change it.
I'm using VS Code for OSX
As you pointed out, VS scroll bar has 2 modes: Bar mode and Map mode.
To turn off annotations (in Bar mode):
In VS, go to: Tools -> Options -> Text Editor -> All Languages -> Scroll Bars
Uncheck: Show annotations over vertical scroll bar
Go to Code > Preferences > Settings to open user settings and add following line "editor.selectionHighlight": false, and it will stop highlighting selection.
You can customize the colors used in the overview ruler in your VS Code settings.json file. Use a transparent color such as "#fff0" to hide the annotations. The list of annotations is in the VS Code docs here (search for overview ruler).
For example, to turn off selection highlighting, bracket matching, and modifications in the scrollbar, add this to your settings.json file:
"workbench.colorCustomizations": {
"editorOverviewRuler.wordHighlightForeground": "#fff0",
"editorOverviewRuler.bracketMatchForeground": "#fff0",
"editorOverviewRuler.addedForeground": "#fff0",
"editorOverviewRuler.deletedForeground": "#fff0",
"editorOverviewRuler.modifiedForeground": "#fff0",
},

How can I hide indent guides in Visual Studio Code?

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?
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,
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.
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.
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.
SOLVED:
"editor.renderIndentGuides": false
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.

How can you disable Gutter Indicators in VS Code?

In VS Code, if there's version control in a folder you're working in, it will try and indicate what lines are new and what lines are changed with little color patches in the "gutter" section. Actually, both on the left side near the line numbers, and also on the right side in the scroll bar. Is there a way to turn that off?
It is possible to change it in settings.json Ctrl+,
"scm.diffDecorations": "all" | "gutter" | "overview" | "none"
Or you can make them transparent:
"workbench.colorCustomizations": {
// Gutter indicators (left)
"editorGutter.modifiedBackground": "#0000",
"editorGutter.addedBackground": "#0000",
"editorGutter.deletedBackground": "#0000",
// Scrollbar indicators (right)
"editorOverviewRuler.addedForeground": "#0000",
"editorOverviewRuler.modifiedForeground": "#0000",
"editorOverviewRuler.deletedForeground": "#0000"
}
Just go to Settings and search for "Scm Diff Decorations" and set to none.
Go to File> Preferences> Settings> Features> SCM.
Shortcut: [ Ctrl ][ Shift ][ P ] > Preferences: Open User Settings> Features> SCM.
Set Diff Decorations to none.
Note that setting other options like the Gutter options shown below may remove some parts of it, but may leave the little red arrow while setting the Diff Decorations option to none will remove everything.
Look under Settings -> Features -> SCM -> Diff Decorations and set to none
If you arrived here, wanting to turn this feature off because you kept clicking on the SCM gutter bars by accident and accidentally opening the diff when you don't want to, this may be of value to you.
As an alternative to turning this useful feature off, consider setting the "SCM: Diff Decorations Gutter Action" instead. This setting controls what happens when you click on the gutter bars; setting to "none" prevents them from being clickable. This allows you to keep the visual information they provide while getting rid of the unwanted behavior.
"scm.diffDecorationsGutterAction": "none", // suppress opening diffs in margin ("gutters")
In Visual Studio 2022 Under Tools --> Options --> Text Editor --> General --> Remove tick from Track changes.

Make the code folding icons always show in Visual Studio Code

Loving using Visual Studio Code but one peeve is that I always think my code isn't indented properly since the left edge of the actual editor is kind of far from the numbers.
Is there any way to show the code folding +/- icons by default? It only shows them if you hover over the gutter.
As an aside, if there is a way to change the color of the gutter so it looks distinct from the editor?
To change the color of the gutter, you can add following to the user settings:
"workbench.colorCustomizations": {
"editorGutter.background": "#abcdef"
}
And to show folding icons:
"editor.showFoldingControls": "always"
Note that this setting requires you to have at least 1.13.
You cannot make code folding icons appear persistently. It is discussed here on project github page however it is not implemented yet.
If you want proper indentation your best bet is indentation guides (the vertical lines that run down to matching indents).
Indentation guides are not displayed by default.To enable indent guides go to File --> Preferences --> Settings and then place following line in settings.json file,
"editor.renderIndentGuides": true
you can make code folding icons appear persistently by addding :
"editor.showFoldingControls": "always",
but not in the "workbench.colorCustomizations", just put it outside and it will work.
example:
"editor.showFoldingControls": "always",
"workbench.colorCustomizations": {
"editor.renderIndentGuides": true,
"scrollbarSlider.background": "#474552",
"scrollbarSlider.hoverBackground": "#295377",
},
and since the [+][-] icons were replaced with [>][v], you can use this extension to regain this feature: Minimalist Product Icon Theme
I know this is an old thread, but FWIW:
File > Preferences > Settings
User > Text Editor > Editor: Show Folding Controls
Select "Always"