3

I'm in the process of switching over to VS Code from Notepad++

The number one thing bugging me at the moment is in a file a PHP tag is the same colour coding as a DIV element. I'd like to change the colour of the PHP tags to be some shade of red.

Just using the default VS Dark theme.

TIA

2 Answers 2

11

You can also make this change in your user settings. I included some additional customizations I use to bold function, keywords, etc... These types of changes should be placed in the user settings file rather than customizing a specific theme file - since your changes will be lost when the theme is upgraded.

    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": [
                    "punctuation.section.embedded.begin.php",
                    "punctuation.section.embedded.end.php"
                ],
                "settings": {
                    "foreground": "#ff0000"
                }
            },
            {
                "scope": "keyword",
                "settings": {
                    "fontStyle": "bold"
                }
            },
            {
                "scope": "storage",
                "settings": {
                    "fontStyle": "bold"
                }
            },
            {
                "scope": "constant.language",
                "settings": {
                    "fontStyle": "bold"
                }
            },
            {
                "scope": "support.class.builtin",
                "settings": {
                    "fontStyle": "bold"
                }
            }
        ]
    }
1
  • Perfect, provided me with more than i was after, simply copying these into my user settings change my tags to red and also added some other cool things
    – OniJoshin
    Jun 27, 2018 at 13:36
1
+50

As far as the themes, VS Code is every bit editable.

The file you are looking for is at :

Microsoft VS Code\resources\app\extensions\theme-defaults\themes

on Windows and search for file name dark_vs.json to locate it on any other system.

The section you'd want to change is this :

{
    "scope": [
        "punctuation.section.embedded.begin.php",
        "punctuation.section.embedded.end.php"
    ],
    "settings": {
        "foreground": "#569cd6"
    }
}

Feel free to chante the foreground color to whatever you'd like. You can, as well, modify any other color you'd like.

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.