Home > OS >  VS Code change comment BACKGROUND color
VS Code change comment BACKGROUND color

Time:06-11

Is this even possible? I do it in full-blown Visual Studio and it's very helpful. Any time you search "VS Code change text/comment background color" you just find articles on how to change the editor's background color. I want to change the background color of comments so they look like they're always highlighted and stand out.

CodePudding user response:

You can use the extension Highlight

An example setting for C and JavaScript comments:

"highlight.regexes": {
  "(//.*)": [
    {
      "overviewRulerColor": "#ffcc00",
      "backgroundColor": "#ffcc00",
      "filterLanguageRegex": "cpp|javascript"
    }
  ]
}

If you also have /* */ comments you have to add another regex that also spans line endings.

  • Related