Answer a question

In VS Code, I'd like to customise some textMateRules the same for multiple themes. For example, both for Atom One Dark and Default Dark+ but without affecting any of the other themes, I'd like to make the keywords italic. I can achieve this by duplicating the same settings twice separately for each theme as below

  "editor.tokenColorCustomizations": {
    "[Atom One Dark]": {
      "textMateRules": [
        {
          "scope": [ "keyword" ],
          "settings": { "fontStyle": "italic" }
        }
      ]
    },
    "[Default Dark+]": {
      "textMateRules": [
        {
          "scope": [ "keyword" ],
          "settings": { "fontStyle": "italic" }
        }
      ]
    }
  }

How can I only need to set up once for both, without duplicating the rules, especially if there are a lot same rules for the multiple themes? Something like the below (but which doesn't work though)

  "editor.tokenColorCustomizations": {
    "[Atom One Dark] [Default Dark+]": {
      "textMateRules": [
        {
          "scope": [ "keyword" ],
          "settings": { "fontStyle": "italic" }
        }
      ]
    }
  }

Answers

Microsoft will add this feature if microsoft/vscode#103694 gets upvoted enough. The behaviour you want is not possible unless you customise every theme.

{
  "editor.tokenColorCustomizations": {
    "textMateRules": [
      {
        "scope": [ "keyword" ],
        "settings": { "fontStyle": "italic" }
      }
    ]
  }
}
Logo

开发云社区提供前沿行业资讯和优质的学习知识,同时提供优质稳定、价格优惠的云主机、数据库、网络、云储存等云服务产品

更多推荐