0

Okay, I'll keep it straight:

I don't know JSON files. I've tried copy pasting numerous online solutions directly into settings.json to disable italic font for VS Code. None of them ever worked.

Here's what I tried:

I use Fira Code Font and Tokyo Night Color Theme. Does this combination somehow make it impossible for me to deactivate italics? The only words bothering me are "if, else, in, for, while" etc...

Can someone shed some light on this programming noob? Am I doing something wrong? Is it just impossible?

Also, I've messed around so much that, when "Inspecting Editor Tokens and Scopes", when I select a for this is what it shows:

image

2 Answers2

1

Add this to the settings.json

"editor.tokenColorCustomizations": {
    "textMateRules": [
        {
            "scope": [
                "comment",
                "punctuation.definition.comment",
            ],
            "settings": {
                "fontStyle": ""
            }
        }
    ]
},
buddemat
  • 4,552
  • 14
  • 29
  • 49
Rares
  • 86
  • 1
  • 8
  • Thanks! This didn't work, but it guided me towards the Tokyo Night extension (My Color Theme) where they have a similar code addressing this italic behavior directly! – Lukeberry Pi Oct 12 '21 at 17:25
0

The solution to this, in my case, was to paste this code I found on the extension page in VS Code into settings.json:

"editor.tokenColorCustomizations": {
        "[Tokyo Night]": { // or "[Tokyo Night Storm]"
            "textMateRules": [{
                "scope": [
                    "comment",
                    "meta.var.expr storage.type",
                    "keyword.control.flow",
                    "keyword.control.return",
                    "meta.directive.vue punctuation.separator.key-value.html",
                    "meta.directive.vue entity.other.attribute-name.html",
                    "tag.decorator.js entity.name.tag.js",
                    "tag.decorator.js punctuation.definition.tag.js",
                    "storage.modifier"
                ],
                "settings": {
                    "fontStyle": ""
                }
            }]
        }
    },

To my understanding, this addressed my Color Theme directly, whereas other solutions didn't.

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83