Skip to content

Instantly share code, notes, and snippets.

@junagao
Last active January 24, 2024 13:30
Show Gist options
  • Star 43 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save junagao/f785ed77589246a3d063273b3a56f114 to your computer and use it in GitHub Desktop.
Save junagao/f785ed77589246a3d063273b3a56f114 to your computer and use it in GitHub Desktop.
VSCode italic font settings

VSCode italic font settings

Add this to settings.json (cmd ,):

{
  "editor.fontFamily": "Operator Mono, Fira Code iScript, Menlo, Monaco, 'Courier New', monospace",
  "editor.fontLigatures": true,
  "editor.tokenColorCustomizations": {
    "textMateRules": [
      {
        "scope": [
          //following will be in italic
          "comment",
          "entity.name.type.class", //class names
          "constant", //String, Number, Boolean…, this, super
          "storage.modifier", //static keyword
          "storage.type.class.js", //class keyword
          "keyword", //import, export, return…
        ],
        "settings": {
          "fontStyle": "italic"
        }
      },
      {
        "scope": [
          //following will be excluded from italics (VSCode has some defaults for italics)

          "invalid",
          "keyword.operator",
          "constant.numeric.css",
          "keyword.other.unit.px.css",
          "constant.numeric.decimal.js",
          "constant.numeric.json"
        ],
        "settings": {
          "fontStyle": ""
        }
      }
    ]
  },
}

Resources

https://www.cufonfonts.com/font/operator-mono https://github.com/kencrocken/FiraCodeiScript https://github.com/tonsky/FiraCode

"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true`

https://github.com/kosimst/FiraFlott

@iamwebwiz
Copy link

Nice! Thanks for this!

@daviavmello
Copy link

Thank you!

@nephlin7
Copy link

Cool. Thanks for sharing!

@Dannis-ARM
Copy link

Thank you!

@Abdul-qowiyy-coder
Copy link

Nice

@prakharporwal
Copy link

where can I find a guide for all available options ? to create a rule for myself.

@r-amee
Copy link

r-amee commented Apr 2, 2023

Thank you so much!

@iDevelop25
Copy link

Thanks bro

@Tosarc
Copy link

Tosarc commented Nov 11, 2023

Thanks bro

@izam-mohammed
Copy link

I can't paste this into settings.json

@git58
Copy link

git58 commented Jan 24, 2024

Why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment