方式一:

使用快捷键 Ctrl+Shift+P 打开 settings.json 文件,添加如下内容:

"workbench.colorCustomizations": {
    "tab.activeBackground": "#00b7ff9d",
    "editor.lineHighlightBackground": "#ffd00033"
},
"editor.semanticTokenColorCustomizations": {
    "enabled": true,   // enable for all themes
    "rules": {
        "property": {
            "foreground": "#10ec98",
            "fontStyle": "bold"
        },
        "macro": {
            "foreground": "#569CD6",
            "fontStyle": "bold"
        },
        "function": {
            "foreground":  "#bacf43",
            "fontStyle": "bold"
        },
        "variable.global": {
            "foreground": "#9cdcfe",
            "fontStyle": "bold"
        },
        "variable.local": {
            "foreground": "#9cdcfe",
            "fontStyle": "italic" //斜体
        },
        "enumMember": {
            "foreground": "#ec106c",
            "fontStyle": "bold"
        },
    }
}

方式二,如下:

    "editor.tokenColorCustomizations": {
        "comments": "#55aa7f",     // 注释
        "keywords": "#569CD6",     // 关键字
        "variables": "#5eccf8",    // 变量名 函数的参数名 
        "strings": "#00ff7f",      // 字符串
        "functions": "#ffbb00",    // 自定义及内置的函数
        "numbers": "#00eeff",      // 数字
        "types": "#55bbff",        // 类定义颜色
        "textMateRules": [  
        { // 设置左单双引号的颜色
            "scope": "punctuation.definition.string.begin",
            "settings": {
                "foreground": "#00ff7f",
                "fontStyle": "bold"  //加粗
            }
        },
        { //设置右单双引号的颜色
            "scope": "punctuation.definition.string.end",
            "settings": {
                "foreground": "#00ff7f",
                "fontStyle": "bold"
            }
        },
        ]
    }

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐