Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode specific word color

Is there some way to colorize a specific word with a custom color?

I'm looking at "editor.tokenColorCustomizations" but nothing seems to hint at this.

I'd like to easily discern a specific piece of code like for example a custom method from everything else, say for example in javascript you use console.log() often to help you with debugging, i'd like that specific method to have a, say, red background, but not other console methods like console.clear()

Any way to do that?

like image 703
Lucas Avatar asked Feb 28 '18 10:02

Lucas


People also ask

How do you highlight the same word in VS Code?

Ctrl+D selects the word at the cursor, or the next occurrence of the current selection. Tip: You can also add more cursors with Ctrl+Shift+L, which will add a selection at each occurrence of the current selected text.

How do I change the color of text in Visual Studio?

On the menu bar, choose Tools > Options. In the options list, choose Environment > Fonts and Colors. In the Show settings for list, choose Environment. If you want to change the font for tool windows only, in the Show settings for list, choose All Text Tool Windows.


1 Answers

You could do that easily with the extension TODO Highlight. In your settings.json:

 "todohighlight.keywords": [

    {
        "text": "console.log",
        "color": "#ffffff",
        "backgroundColor": "red",
        "overviewRulerColor": "grey"
    }
  ]
like image 175
Mark Avatar answered Sep 28 '22 16:09

Mark