Could some one explain to me please how to customize docstring color for Python in VSCode's default theme? I want to do it thru User Settings because want to be able to save my config file.
I tried to use "editor.tokenColorCustomizations": {} but it affects all strings.
Adding to Leonard's answer, if you want to change the triple quotes and escapes too, use the below:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"string.quoted.docstring.multi.python",
"string.quoted.docstring.multi.python punctuation.definition.string.begin.python",
"string.quoted.docstring.multi.python punctuation.definition.string.end.python",
"string.quoted.docstring.multi.python constant.character.escape.python"
],
"settings": {
"foreground": "#aab5da" //change to your preference
}
}
]
},
Also, I had a hard time finding the user settings file in json format. You can find that by:
CTRL + SHIFT + P > User Settings > On the open tab level extreme right hand side > Open Settings (JSON) icon (Hover to know which icon)
Add this to your setting file:
<!-- language: json -->
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope":"string.quoted.docstring.multi.python",
"settings": {
"foreground": "#69676c" //change to your preference
}
}
]
}
additional info:
for finding out the scope of other element, you use the command Developer: Inspect TM Scopes
, as described here https://github.com/Microsoft/vscode/pull/29393
more detail: https://code.visualstudio.com/docs/getstarted/themes#_customize-a-color-theme
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