How to turn off "matching" highlighting in VS Code? - visual-studio-code

I don't want Visual Studio Code to highlight matching brackets, all occurrences of the same variable, etc. I find it very distracting. However, I can find no way to disable this feature.
The only highlight options I seem to be able to change are "editor.selectionHighlight" and "editor.renderLineHighlight", and neither work.
Is it possible to disable "matching highlighting"? Or maybe to edit my theme, so that the highlight color and highlight border are the same as the background color?

There are different types of highlighting:
1. Syntax highlighting (place cursor inside variable)
"editor.occurrencesHighlight": false
2. Selection highlighting (similar chunks in document)
"editor.selectionHighlight": false
3. Matching brackets highlighting
"editor.matchBrackets": false
There's a second way - make them less obtrusive (or completely transparent):
"workbench.colorCustomizations": {
"editor.selectionHighlightBackground": "#0000", // similar selection
"editor.selectionHighlightBorder": "#0000",
"editor.wordHighlightStrongBackground": "#0000", // syntax variable assignment
"editor.wordHighlightStrongBorder": "#0000",
"editor.wordHighlightBackground": "#0000", // syntax variable
"editor.wordHighlightBorder": "#0000",
"editorBracketMatch.border": "#0000",// brackets
"editorBracketMatch.background": "#0000",
}

Try this one "editor.matchBrackets": false in your Preferences - User/Workspace setting

"Occurrences Highlight" is the setting you are looking for.

Try going to Preferences-> User Settings
In the settings.json to the right add:
"editor.selectionHighlight": false

The same achievement from #Alex's answer could be done from the VSCode settings.
Go to Preferences -> Settings and there search for Highlight.
A lot of option would appear, but the ones useful would be under the Text Editor section.
Also, you could decide if change it globally (through the User Settings) or just for that window (Workspace Settings).

Related

How to I remove whole line highlighting in VScode?

I want VSCode line highlight to look like this
Currently, it looks like this
Basically I dont want VSCode to highlight the entire line.
Look at the options for this setting:
Editor: Render Line Highlight
options are none, gutter, line and all
You cannot just highlight the text part of the line. If that is what you want, look at the gutter option perhaps. If you just want to reduce the obviousness of the highlight, use #rioV8's answer - the last two digits in the hex are opacity.
add this to your settings.json (global or project)
"workbench.colorCustomizations": {
"editor.lineHighlightBackground": "#00000000"
},
Set the line highlight to a transparent color

VSCode disable highlight matching

How can I replace this annoying white rectangle with anything nicer?
I tried to disable it in user settings using
"editor.matchBrackets": "never",
but it didn't work.
That highlighting appears to be editor.selectionHighlightBackground assuming you selected editor. There is also editor.selectionHighlightBorder you can change. Like so:
"workbench.colorCustomizations": {
"editor.selectionHighlightBackground": "#e90505",
"editor.selectionHighlightBorder": "#ff000080" // digits 7 and 8 are opacity
}
You can turn off this highlighting of selection matches by disabling this setting:
Editor: Selection Highlight
Such highlighting could also be the result of find matches. Please advise if that is what you used, the Find/Replace widget.

How to disable error squiggles in visual studio code

I am using Visual Studio Code to program in C++ but it keeps giving me error squiggles. I tried disabling them in the settings by changing C_Cpp error squiggles to disabled but they still appear. Is there anything else I need to do to disable them as I find them very annoying?
The straightforward thing works
What you said you did works for me in VSCode 1.37.1.
Before, with defaults:
Changing the setting:
After:
Excerpt of settings.json:
{
....
"C_Cpp.errorSquiggles": "Disabled"
}
Hypotheses about why it did not work for you
There is another settings.json attribute called C_Cpp.default.enableConfigurationSquiggles. Might you have accidentally changed that one?
Is "C_Cpp: Intelli Sense Engine" set to "Default"? It should be (rather than "Tag Parser") in order to disable squiggles.
Maybe the syntax error you have is different somehow?
For ease of reproduction, it would help to see your settings.json, c_cpp_properties.json, and an example of erroneous syntax with squiggles.
Currently, there is no settings to turn the error decorations off but some language extensions implement their own solutions.
If you are looking for a language agnostic solution, you can make the squiggly lines transparent by adding following setting to general settings or workspace settings file.
"workbench.colorCustomizations": {
// ↓↓
"editorError.foreground": "#00000000"
}
For a specific language:
"workbench.colorCustomizations": {
"[jsonc]": {
// ↓↓
"editorError.foreground": "#00000000"
}
}
Please note that we use 8-digit hex value, the first six is not important but last two should be zero to make the color transparent.
Here is how you can do it programmatically in an extension:
workspace.getConfiguration('workbench').update( 'colorCustomizations', {
"editorError.foreground": "#00000000",
});
just go to command palette (ctrl + shift + P) and then search C/C++ enable error squiggles and select that. Done

How to disable angle bracket highlighting in Visual Studio Code?

I just want to disable the character highlighting that happens on angle brackets, as I find the square box to be annoying. Is there a way to turn it off?
You can search keyword highlight in setting, and you change Editor:Match Bracket to never, like this:
You can use the following:
// Highlight matching brackets when one of them is selected.
"editor.matchBrackets": false, however it disables highlighting all the brackets not only the angle brackets.
You can always make the bracket border color transparent with these settings:
"workbench.colorCustomizations": {
"editorBracketMatch.border": "#0000",
"editorBracketMatch.background": "#000"
}
This will make the border transparent and the bracket's background black - or just make it something less obtrusive given your editor background. But again, this will apply to all brackets, not just angle brackets.
Unfortunately it's still unconfigurable. Maybe they will improved it.
Here is my ticket in VSCode repo that you can watch - https://github.com/microsoft/vscode/issues/73521.
As long as they do not improve, you have two ways
Solution with addon:
Disable native bracket matching: "editor.matchBrackets": false,
Install addon from https://marketplace.visualstudio.com/items?itemName=rafamel.subtle-brackets
Customize it for better visuality, example:
"subtleBrackets.style": {
"borderStyle": "solid",
"borderColor": "#CC7832",
"borderRadius": "3px",
}
Native solution without addon:
You can disable bracket matching highlight only for specific language:
"[html]": {
"editor.matchBrackets": false
}
Note that this is not a perfect solution, because when using html in php files, angle brackets are still highlighted
You can add this
{
"editor.matchBrackets": "near"
}
somewhere in ~/.config/Code/User/settings.json. This means that all projects inherit behavior.
This way, only when you move the cursor over a bracket, the corresponding one is shown.
Yaa. there is a solution for hiding the annoying marking I just found. go to the setting button in left bottom side then write- angle bracket -in the search option and search as well. Then press the "text editor", a selecting option will come in the top named "Editor:Match Brackets". Select "Never" and your work is done here. See the attached picture if needed.

Change bracket highlight weight in VS Code to be more visible

I'm just getting VS Code set up to use, one of the things I like to have is highlighting that's visible so I don't have to really look for it. I have the editor.matchBrackets setting set to true, so my brackets are highlighted when one is selected. However, the highlighting is so faint (very thin lines) that it's hard to see (I'm using the Dark+ theme, one of the default themes). Is there a way to affect the bracket highlighting, such as the color, line size, etc, so that it's easy to see?
Thanks.
You can try this extension Subtle Brackets by modifying the following the default values in the .json settings of VS Code:
I changed it like this:
"subtleBrackets.bracketPairs": [
"{}",
"[]",
"()",
"<>"
],
"subtleBrackets.styles": {
"global": {
"color": "yellow",
"borderWidth": "1px",
"borderStyle": "none none solid none"
}
}
Don't forget to set to "false" the value of .matchbrackets of VS Code.
"editor.matchBrackets": false
you can add this setting to your settings.json file to apply lighter color brackets. You can just customize these colors of your interest. Bracket pair colorization should be enabled in settings
"workbench.colorCustomizations": {
"editorBracketHighlight.foreground1": "#ffffff",
"editorBracketHighlight.foreground2": "#ffb534",
"editorBracketHighlight.foreground3": "#d549ff",
"editorBracketHighlight.foreground4": "#44ecff",
"editorBracketHighlight.foreground5": "#9eff3e",
"editorBracketHighlight.foreground6": "#2e74ff",
"editorBracketHighlight.unexpectedBracket.foreground": "#db6165"
}
If you want to have the same color for all nested brackets, you can disable "independent color pool per bracket type" in the settings.
Unfortunately, you can't do that.
You should look for another Theme that fit your needs, or maybe upvote this issue in VS Code repo which seems similar to your needs. This issue also suggest install an extension that colorize brackets. It's not a solution, but might help.