如何修改VSCode中的代码样式

在很多时候我们修改VSCode的主题,代码样式也会随之变化,但是经常会遇到:

我喜欢这个主题的整体风格,但是不喜欢这个主题的代码样式。

接下来就给大家看看我的配置文件,颜色可以自己修改~

截图 2023-02-17 16-43-26

    "workbench.colorCustomizations": {
        "editor.selectionBackground": "#589dfd72",//选择后背景色
        "editor.background":"#252525"//编辑器整体背景颜色
        
    },
    "editor.wordWrap": "on",//启用自动换行
    "editor.lineHeight": 22,//行高
    "editor.letterSpacing": 0.6,//字母间距
    "editor.tokenColorCustomizations": {
        "strings": "#6A8759",//字符串
        "textMateRules": [
            {
                "scope": "keyword",//关键字
                "settings": {
                    "fontStyle": "italic",
                    "foreground": "#f1961e"
                }
            },
            {
                "scope": "keyword.control",//if ,else, try 等控制符
                "settings": {
                    "foreground": "#f1961e"
                }
            },
            {
                "scope": "keyword.operator",//算数符
                "settings": {
                    "foreground": "#ffffff"
                }
            },
            {
                "scope": "variable",//变量名
                "settings": {
                    "foreground": "#9CDCFE"
                }
            },
            {
                "scope": "constant",//常量
                "settings": {
                    "foreground": "#9876aa"
                }
            },
            {
                "scope": "entity.name.function",//函数名
                "settings": {
                    "foreground": "#ffc66d"
                }
            },
            {
                "scope": "constant.numeric",//数字
                "settings": {
                    "foreground": "#6897bb"
                }
            },
            {
                "scope": "storage.modifier",//修饰语
                "settings": {
                    "foreground": "#f1961e"
                }
            },
            {
                "scope": "entity.name.type.class",//类名
                "settings": {
                    "foreground": "#a9b7c6"
                }
            },
            {
                "scope": "storage.type.primitive.java",//int和其他啥啥,忘记了
                "settings": {
                    "foreground": "#c0526a"
                }
            },
            {
                "scope": "entity.name.type.interface",//接口
                "settings": {
                    "foreground": "#a9b7c6"
                }
            },
            {
                "scope": "entity.name.namespace",//导入部分
                "settings": {
                    "foreground": "#74817c"
                }
            },
            {
                "scope": "entity.name.tag",//html标签
                "settings": {
                    "foreground": "#6897ff"
                }
            },
            {
                "scope": "comment.block",//块注释
                "settings": {
                    "foreground": "#13ad00"
                }
            },
            {
                "scope": "comment.line",//行注释
                "settings": {
                    "fontStyle": "italic",
                    "foreground": "#13ad00"
                }
            },
            {
                "scope": "punctuation.separator",//标点符号
                "settings": {
                    "foreground": "#cc7832"
                }
            },
            {
                "scope": "punctuation.terminator",
                "settings": {
                    "foreground": "#cc7832"
                }
            }
        ]
    }
    

我的这部分修改是按照idea的风格设置的,大家可以改成自己喜欢的样子~