I would like to make variables displayed with colours.
This is how it looks:
This is how I want it to be:
Looking through here, I cannot find any settings that allow me to change this.
Press 'Ctrl+shift+P' from the keyboard to open VS Code command palette. Search: 'Inspect Editor Tokens and Scopes' Take the cursor on the text or tag, if you want to change the colors.
The active color theme is stored in your user settings (keyboard shortcut Ctrl+,). Tip: By default, the theme is stored in your user settings and applies globally to all workspaces. You can also configure a workspace specific theme. To do so, set a theme in the Workspace settings.
To customize it, you have to edit the settings file used by your VS Code. To do that, open the VS Code Command Palette, search for “Settings. json” and edit it.
Try this setting in your settings.json:
"editor.tokenColorCustomizations": {
"variables": "#f00"
},
There are a few such simple token color customizations available: variables, comments, keywords, functions, numbers, strings and types. Those only allow setting the color though.
If you use "textMateRules" you can set more properties. For example:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "comment",
"settings": {
"fontStyle": "italic",
"foreground": "#C69650"
}
}
]
},
This is working for me. It makes it look like the default Javascript formatting as far as I can see.
In settings.json
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "meta.function-call.generic.python",
"settings": {
"foreground": "#DCDCAA"
}
},
{
"scope": "source.python",
"settings": {
"foreground": "#9CDCFE"
}
},
{
"scope": "punctuation.definition.string.begin",
"settings": {
"foreground": "#ce9178"
}
},
{
"scope": "punctuation.definition.string.end",
"settings": {
"foreground": "#ce9178"
}
},
{
"scope": "punctuation",
"settings": {
"foreground": "#dfdfdf"
}
}
]
}
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