简体   繁体   中英

how to change the color of variables in VScode?

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

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.

You can try with command line:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM