Change the color of special characters in VS Code?

Viewed 3459

In VS Code, I would like to highlight any tab characters that appear in my code in bright red as I prefer to use spaces only.

I have the render whitespace setting enabled, and I have looked through the Theme Color configurations, but I am not seeing anything that I can set relating to special characters.

Is there any way currently to add this customization?

2 Answers

As mentioned by rioV8, the method to do this is to use the Highlight extension for VS Code and add this to your settings.json:

"highlight.regexes": {
    "(\\t)": [
        {
            "color": "red"
        }
    ]
}

On the menu bar, which is the row of menus such as File and Edit, choose Tools > Options. On the Environment > General options page, change the Color theme selection to Dark, and then choose OK. The color theme for the entire Visual Studio development environment (IDE) changes to Dark.

Related