PHP Syntax Highlight in Sublime Text

10,900

Solution 1

You just need to have a color scheme that has the correct scopes. For example, this is how similar code looks like using the Neon Color Scheme:

PHP $var in string

Solution 2

I use this kind of highlight: enter image description here

It helps me a lot when php code is together with other html code.

You have to edit your theme .tmTheme file, as mine is Monokay.tmTheme so right after the </array> command i used the code above:

    <dict>
        <key>scope</key>
        <string>punctuation.section.embedded.begin.php</string>
        <key>settings</key>
        <dict>
            <key>foreground</key>
            <string>#FF0000</string>
        </dict>
    </dict>

    <dict>
        <key>scope</key>
        <string>punctuation.section.embedded.end.php</string>
        <key>settings</key>
        <dict>
            <key>foreground</key>
            <string>#FF0000</string>
        </dict>
    </dict>
Share:
10,900
gskalinskii
Author by

gskalinskii

Updated on August 21, 2022

Comments

  • gskalinskii
    gskalinskii over 1 year

    I've got issues with syntax highlighting in following cases:

    enter image description here

    How can I get variables highlighted when mixed with strings?