Ruth Anderson
Ruth Anderson

Reputation: 11

Making certain words bold or italic [VSCode]

I am currently working with classes, and I would like the keyword "self" to stand out by making it bold.

I have searched around the internet and cannot find anything of use. I managed to get comments to turn italic but I can't figure out how to make certain words a specific font style.

Any ideas?

my current settings.json

    "editor.tokenColorCustomizations": {
        "textMateRules": [{
                "scope": "comment",
                "settings": {
                        "fontStyle": "italic"
                }
        }]
    },
    "json.schemas": [
    ]
    
    
}

Upvotes: 1

Views: 3731

Answers (1)

tHeSiD
tHeSiD

Reputation: 5343

You cannot make specific words bold or italic, you can only style tokens/scopes the way you want.

The simplest way to find the token for the words you want to style is to use the "Developer: Inspect Editor Tokens and Scopes" option inspect

Then select the word you want to get the scope for

scopes

Style the active scope as you like in your settings.json

Read more : Syntax Highlighting Guide

Upvotes: 1

Related Questions