56

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?

TylerH
  • 20,799
  • 66
  • 75
  • 101
VTGroup
  • 569
  • 1
  • 4
  • 5

5 Answers5

115

There are different types of highlighting:

1. Syntax highlighting (place cursor inside variable)

enter image description here

"editor.occurrencesHighlight": false

2. Selection highlighting (similar chunks in document)

enter image description here

"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",
}
halfer
  • 19,824
  • 17
  • 99
  • 186
Alex
  • 59,571
  • 22
  • 137
  • 126
  • 1
    There's also a double clicking on a word. which one is that ? – Royi Namir Feb 12 '19 at 17:31
  • It will highlight both (selection & symbol) on symbol. And only (selection) on non-symbol word. – Alex Feb 12 '19 at 21:54
  • **more info based on this answer with even more images, tips!** https://stackoverflow.com/a/63303503/294884 – Fattie Aug 11 '20 at 15:33
  • The first kind of highlighting in image one is called "Occurrences Highlight" and can be modified by `"editor.selectionHighlightBackground": "#ff0000"`. More info can be seen here https://code.visualstudio.com/api/references/theme-color#editor-colors:~:text=editor.selectionHighlightBackground%3A%20Color%20for%20regions%20with%20the%20same%20content%20as%20the%20selection. – Mark Nov 27 '22 at 17:06
11

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

image here

TylerH
  • 20,799
  • 66
  • 75
  • 101
Ashraf Farhan
  • 456
  • 5
  • 9
  • 2
    A link to a solution is welcome, but please ensure your answer is useful without it: [add context around the link](//meta.stackexchange.com/a/8259) so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. [Answers that are little more than a link may be deleted.](//stackoverflow.com/help/deleted-answers) – FelixSFD Apr 14 '17 at 17:42
8

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

Shivam Tomar
  • 91
  • 1
  • 1
7

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

"editor.selectionHighlight": false
CKE
  • 1,533
  • 19
  • 18
  • 29
  • I actually have that set, for both User and Workspace settings. It does not seem to turn off brace highlighting or all-other-instances-of-the-current-word highlighting. Here's my settings.json file for both: // Place your settings in this file to overwrite default and user settings. { "editor.selectionHighlight": false, "editor.renderLineHighlight": false } – VTGroup Sep 29 '16 at 19:58
  • Are you sure you are not setting // Controls whether the editor should highlight similar matches to the selection "editor.selectionHighlight": true, in your workspace settings? – Mark Sep 29 '16 at 20:37
  • I just double-checked. Both User and Workspace settings.json files have the same two values set: "editor.selectionHighlight": false, "editor.renderLineHighlight": false. If selectionHighlight is supposed to control matching-brace highlighting, then maybe I've got something else causing it not to work. And I completely forgot to mention I'm on a Mac, in case that's relevant. – VTGroup Sep 29 '16 at 21:31
3

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).

InstictV
  • 162
  • 1
  • 9
  • In recent versions of VS code, at least as of ver 1.50, this answer helps. To note that you have the "Workspace" settings tab only if you have saved a workspace. – Tarqez Oct 15 '20 at 21:22