简体   繁体   English

更改 PHP 标记语法突出显示

[英]Change PHP Tag Syntax Highlighting

I'm working with WordPress which mixes PHP and HTML in their .php files.我正在使用 WordPress,它在.php文件中混合了 PHP 和 HTML。 Right now open/closing PHP and HTML tags are the same blue color ( on the dark theme ).现在打开/关闭 PHP 和 HTML 标签是相同的蓝色(在深色主题上)。 I'm wondering if there's a way to change the color of the opening/closing PHP tags to better differentiate the PHP and HTML sections?我想知道是否有办法更改打开/关闭 PHP 标记的颜色以更好地区分 PHP 和 HTML 部分? Here's a screenshot demonstrating what I mean.这是一个截图,展示了我的意思。

在此处输入图片说明

Install material-theme as an extension.安装material-theme作为扩展。 Change color theme and set accent color as your wish.更改color theme并根据需要set accent color You will find those settings on preference .您将在preference找到这些设置。 On Linux press ctrl+shift+p and search for color theme after installing the Material theme or any other theme that you prefer.在 Linux 上按ctrl+shift+p并在安装 Material 主题或您喜欢的任何其他主题后搜索颜色主题。

Add that to your settings.json (It will set the color to #d65656)将其添加到您的 settings.json (它将颜色设置为 #d65656)

"editor.tokenColorCustomizations": {
    "textMateRules": [
      {
        "scope": [
          "punctuation.section.embedded.begin.php",
          "punctuation.section.embedded.end.php",
        ],
        "settings": {
          "foreground": "#d65656"
        },
      }
    ]
  }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM