VS Code custom color scheme

VS Code custom color scheme

VSCode has many good-looking theme plugins. Just enter theme in the plugin search box. There are also recommendations from big guys on the Internet, but they are not in line with my aesthetic habits, so I spent a few days studying the custom color scheme of VSCode. tokenColors, I posted my color matching json here, mainly for C language, other languages ​​are similar, the comments are still quite detailed, you can also re-color according to your own preferences.

It is recommended to put the configuration json code in the global settings (Ctrl+Shift+P, enter settings, you will see Open Settings and Open Workspace Settings, which are the global settings and the current project settings, respectively), and it can be done once and for all.

{
    "editor.fontSize": 16,
    "search.exclude": {     //不需要使用搜索的文件
    
        },
    "files.exclude": {      //不需要显示的文件
          "Listings":true,
          "Objects":true
        },
    "window.zoomLevel": 0.5,                      //窗口缩放 默认是0
    "workbench.colorCustomizations":{
        "editor.background": "#181818",         //编辑器背景
        "sideBar.background": "#202020",        //侧边栏背景
        "editor.lineHighlightBackground": "#002535",//光标所在行背景色
        "editor.selectionBackground": "#005585",    //选中内容背景色
        "statusBar.background": "#252525",          //底部状态栏背景色
        "activityBar.background": "#252525",        //最左侧活动栏背景色
        "tab.activeBackground": "#505050",          //活动栏/标签背景色
        "tab.activeForeground": "#e0e0e0",          //活动栏/标签文字颜色
        //"editorBracketMatch.border": "#ff06ff",     //匹配括号框线颜色
        "editorCursor.foreground": "#ffffff",       //光标颜色
        "sideBarSectionHeader.foreground": "#ebebeb",//大纲字体颜色
        "sideBarSectionHeader.background": "#303030",//大纲背景颜色
        "sideBar.foreground": "#c5c5c5",             //侧边栏前景色
    },
    "editor.tokenColorCustomizations": {
        "comments": "#a3a3a3",
        "functions": "#dfdfdf",
        "strings":"#dd4949",
        "numbers": "#377bd4",
        //"keywords": "#ec8b30ee",
        //"variables": "#dfdfdf",
        "textMateRules": [
            //entity.name.function",                    //直接调用的函数
            //entity.name.type",                        //typedef定义的变量
            //keyword.control",                         //if switch break return
            //keyword.operator.assignment",             // =等号/赋值号 |= &=
            //"keyword.operator.logical",               //逻辑符号 && || !
            //"constant.character.escape",              //"\r\n"\
            //constant.other.placeholder",              //"%s %c"
            //punctuation.definition.comment",          // // /*注释开头
            //constant.numeric",                        //数字:50 10  0x20的20部分
            //keyword.operator.word                     //and or not
            //"scope":"meta",                           //括号 函数声明的括号 调用的括号...
            //punctuation.separator",                   //冒号 逗号
            //punctuation.terminator",                  //分号
            //storage.modifier",                        //static const
            //string.quoted.single",                    //单引号字符串
            //string.quoted.double",                    //双引号字符串
            //string.quoted.triple",                    //三引号字符串
            //"storage.type",                           //void int char 
            //"punctuation.definition.string.begin",    //左双引号
            //"punctuation.definition.string.end",      //右双引号
            {
                "scope":"support.function",
                "settings": {
                    "foreground": "#FF0000",
                    "fontStyle": "bold"
                }
            },
            {                                           
                "scope":"entity.name.type",             //typedef定义的变量
                "settings": {
                    "foreground": "#15ced4de",
                }
            },
            {
                "scope":"storage.type",                 //void int char 
                "settings": {
                    "foreground": "#15ced4de",
                }
            },
            {
                "scope":"storage.modifier",             //static const
                "settings": {
                    "foreground": "#15ced4de",
                }
            },
            {
                "scope":"keyword.operator",             //=等号/赋值号 |= &=
                "settings": {
                    "foreground": "#f051a0",
                }
            },
            {
                "scope":"keyword.control",              //if switch break return
                "settings": {
                    "foreground": "#c67ed4",
                    "fontStyle": ""
                }
            },
            {
                "scope":"keyword.operator.logical",       //逻辑符号 && || !
                "settings": {
                    "foreground": "#d6511c",
                    "fontStyle": ""
                }
            },
            {
                "scope":"constant.character.escape",    //"\r\n"
                "settings": {
                    "foreground": "#ee5050",
                    "fontStyle": ""
                }
            },
            {
                "scope":"variable.other",             //结构体对象和成员等
                "settings": {                         //VSCode使用C的颜色限制,这一点比较坑
                    "foreground": "#dfdfdf",          //比如Public.Delay(),颜色是一起变得
                    "fontStyle": ""                   //不能单独设置Public和Delay的显示颜色
                }								      //可能因为VS Code主要用于前端,对C的支持不够完善
            },
            {
                "scope":"variable.parameter",           //函数参数-定义阶段
                "settings": {
                    "foreground": "#dfdfdf",
                    "fontStyle": ""
                }
            },
            {
                "scope":"entity.name.section",          //函数参数-调用阶段
                "settings": {
                    "foreground": "#b66767",
                    "fontStyle": ""
                }
            }
        ]
    }
}

Also recommend a very beautiful icon plugin VS Code Great Icons
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_42663377/article/details/109966747