I'm writing some python script in VSCode, and I noticed that it's displaying function arguments text in italics
For example
I like the colour, but why is "key" written in italics? I searched all of VSCode settings and couldn't find it - maybe it's the Python extension that's doing this? But I couldn't find settings for that either
Using either CTRL-I or CTRL-SHIFT-I will turn off italics on your keyboard.
type. class. js", //class keyword ], "settings": { "fontStyle": "italic" } }, { "scope": [ //following will be excluded from italics (VSCode has some defaults for italics) "invalid", "keyword.
Every single IDE makes this incredibly difficult. Use vs-code default shortcut keys ctrl+k with ctrl+shift+s (windows) for saving without formatting. Alternatively press ctrl+shift+p and search for save without formatting.
The code formatting is available in Visual Studio Code (VSCode) through the following shortcuts or key combinations: On Windows Shift + Alt + F. On macOS Shift + Option + F. On Linux Ctrl + Shift + I.
Until VSCode adds that setting, the workaround is to add this to the settings.json
:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"comment",
"punctuation.definition.comment",
],
"settings": {
"fontStyle": ""
}
}
]
},
That setting manually uses ''
for the font-style
on comments. Additional scopes may be required depending on where your theme uses italics.
Answer comes from this GitHub issue thread: https://github.com/Microsoft/vscode/issues/32579#issuecomment-813005373
there is an issue open on Github with a workaround: https://github.com/Microsoft/vscode/issues/32579#issuecomment-341502559
You can be more granular and narrow down the list of scopes if you know which one you want to change. To get the list of scopes use "Developer: Inspect Editor tokens and scopes" from the Command Palette (Ctrl+Shift+p)
Screenshot of Textmate Scopes
If you are using an extension for the theme in vscode. Then follow these steps.
Ctrl/cmd + shift + x
-> search extension eg one dark pro
.Extension settings
.Just add this to the settings.json
https://gist.github.com/pauldan/f3dbb3e33ee00acc36ad28c9e1de1bf9
This will work on any theme ✅
Reference: Reddit - Remove italic from VS Code theme
On the latest version of VSCode
, it works on me when I set the scope = ['keyword.control']
and settings.fontStyle = ''
, instead of putting all configs in the scope that didnt related to your concerns
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"keyword.control",
],
"settings": {
"fontStyle": ""
}
}
]
},
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With