自定义VSCode主题中的块引用颜色

时间:2018-12-14 00:45:48

标签: visual-studio-code

我在VScode中使用Nord theme。降价文件中的块引号看起来像这样,很难辨认。如何更改文本背景?

enter image description here

我已经在“用户设置”中尝试了以下操作,但不起作用:

"workbench.colorCustomizations": {
    "textBlockQuote.background": "#ff0000", // changes the markdown preview
    "editor.textBlockQuote.background": "#0000ff", // Property not allowed
    "[Nord]": {
        "textBlockQuote.background": "#ff0000", // changes the markdown preview
    },
},
"editor.tokenColorCustomizations": {
    "textBlockQuote.background": "#ff0000", // Property not allowed
    "editor.textBlockQuote.background": "#ff0000", // Property not allowed
    "[Nord]": {
        "textBlockQuote.background": "#ff0000", // Property not allowed 
        "editor.textBlockQuote.background": "#ff0000", // Property not allowed
    }
},

3 个答案:

答案 0 :(得分:1)

编辑器着色来自文本伴侣语法。要覆盖此设置,您需要使用editor.tokenColorCustomizations

textMateRules部分
"editor.tokenColorCustomizations": {
    "[Nord]": {
        "textMateRules": [
            {
                "scope": "markup.quote.markdown",
                "settings": {
                    "foreground": "#f0f"
                }
            }
        ]
    }
}

此处使用的范围(markup.quote.markdown)是markdown块引号的textmate范围。您可以在VS Code中使用Developer: Inspect TM Scopes命令来确定目标范围

请注意,VS Code不支持设置文本的背景色。已跟踪here

答案 1 :(得分:0)

我使用了 Slack Theme Aubergine Dark ,不得不更改:

   "editor.tokenColorCustomizations": {
        "[Slack Theme Aubergine Dark]": {
            "comments": "#ffa600",
            "textMateRules": [
                {
                    "scope":"markup.quote.markdown",
                    "settings": {
                        "foreground": "#FF0000",
                        "fontStyle": "bold"
                    }
                }
            ]

        },

    },

答案 2 :(得分:-1)

我已经尝试过了,效果很好:

     "workbench.colorCustomizations": { 
       "textBlockQuote.background":"#95e0d6"
    } 

Screenshot