4

I started learning python recently. I use vscode and i really hate the default variable color in vscode(white) i want to change it to something colorful. I tried searching online most of them say to edit in settings.json. I couldn't figure out how.

edit : i edited my settings.json to this

{
    "python.pythonPath": "c:\\Users\\Kakshipth\\Documents\\coding\\py\\virtualauto\\Scripts\\python.exe",
    "code-runner.respectShebang": false,
    
    "editor.tokenColorCustomizations": {
        "variables": "#1100ff"
     },
}

but still the color for variables did not change

default-303
  • 361
  • 1
  • 4
  • 15
  • Try checking this https://stackoverflow.com/questions/47724696/make-vscode-variables-have-colour – Vaclav Pelc Aug 11 '20 at 11:53
  • i saw that post, but i have no idea how to get into `settings.json`, i go to `prefrences -> settings -> extenstions` only to find that there are multiple settings.json files. – default-303 Aug 11 '20 at 12:46
  • Does this answer your question? [How can I switch themes in Visual Studio 2012](https://stackoverflow.com/questions/9594433/how-can-i-switch-themes-in-visual-studio-2012) – dh762 Aug 12 '20 at 10:02
  • @dh762 the question is not about changing the whole color theme. It is about changing the default color with which VS Code marks variables, which is only one small part in the whole scheme. Sure, it would solve the problem, but it seems that OP is ok with the rest of the color theme, just not with this one particular thing. – Vaclav Pelc Aug 12 '20 at 14:05

2 Answers2

8

In Visual Studio Code, use Ctrl + Shift + P and type settings.json to the field that shows up. After you type it, it should give you the settings.json file as the first search result. Just click on it and the file should open. Once you open the settings.json file, you can check this answer to see how to change the color of variables.

Vaclav Pelc
  • 582
  • 6
  • 20
  • thanks, i did you what you said and posted the updated `settings.json` in the question above. I reloded the window but still i get white color for variables – default-303 Aug 14 '20 at 18:00
1

You can try with command line:

 "editor.tokenColorCustomizations": {
    "textMateRules": [
        {
            "scope": "variable",
            "settings": {
                "foreground": "#c70a39",
            }
        }
    ]
}
BlackBold
  • 61
  • 1
  • 1