4

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

enter image description here

How can I get variables highlighted when mixed with strings?

2 Answers 2

4

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

Sign up to request clarification or add additional context in comments.

Comments

1

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>

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.