skip to Main Content

When doing a search of all files in the workspace using the search activity bar, VSCode will highlight all of the search results in the current file.

This is on top of anything that’s being highlighted through other means, including the in-file search feature. It creates a lot of visual noise and makes it hard for me to parse what’s going on. While I’d like to keep it highlighting search results when using the in-file search feature (i.e. the search field activated by pressing Command+F / Control+F), I’d rather it not highlight the search results listed in the search activity bar.

Is there any way to turn that off, but leave highlighting of other search results on?

(Note: this is not the same question as asking about turning off all search highlighting, or turning off selection highlighting. I’m specifically trying to turn off one kind of highlighting, from the search activity bar, while leaving the others on.)

2

Answers


  1. You can adjust the color for search highlight to make less prominent or invisible by adding settings to ur settings.json file.

    for example:

    "workbench.colorCustomizations"{
        "editor.findMatchingHoghlightBackground": "00000000"
    }
    

    it worked for me.

    Login or Signup to reply.
  2. I don’t think there is any direct option to do what you want. As you know the search across files and the find matches share a theme color so you can’t disable one or the other.

    One can try this. Make these keybindings in your keybindings.json:

    {
      "command": "runCommands",
      "key": "ctrl+f",           // whatever keybinding you want
      "args": {
        "commands": [
          {
            "command": "workbench.action.findInFiles",
            "args": {
              "query": "",
              "triggerSearch": true
            }
          },
          "actions.find"
        ]
      }
    },
    
    {
      "command": "runCommands",
      "key": "ctrl+shift+f",   // whatever keybinding you want
      "args": {
        "commands": [
          {
            "command": "editor.actions.findWithArgs",
            "args": {
              "searchString": ""
            }
          },
          "workbench.action.findInFiles"
        ]
      }
    }
    

    Those will disable the find match OR the search match colors showing up by "nulling" either the find widget input or the search view input. So at least you don’t get both theme colors at the same time.

    When you Ctrl+F the search match highlights disappear and when you do Ctrl+Shift+Ctrl the find match highlights are removed. There may not be a better way to accomplish what you want.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search