如何在Sublime text 2中更改类属性的颜色?

时间:2012-05-31 11:38:02

标签: php syntax-highlighting sublimetext sublimetext2

目前,这是突出显示所有变量的代码,包括类属性(它们是红色):

    <dict>
        <key>name</key>
        <string>Variables</string>
        <key>scope</key>
        <string>variable, support.variable</string>
        <key>settings</key>
        <dict>
            <key>fontStyle</key>
            <string></string>
            <key>foreground</key>
            <string>#dc322f</string>
        </dict>
    </dict>

如何更改类属性的颜色?

$object->property = 'xxx';

所以$object应该仍然是红色的,但我希望property采用不同的颜色

2 个答案:

答案 0 :(得分:4)

variable.other.property应该这样做:

<dict>
    <key>name</key>
    <string>Variables</string>
    <key>scope</key>
    <string>variable.other.property</string>
    <key>settings</key>
    <dict>
        <key>fontStyle</key>
        <string></string>
        <key>foreground</key>
        <string>#00ff00</string>
    </dict>
</dict>

答案 1 :(得分:1)

变化:

<string>variable, support.variable</string>

要:

<string>variable.other.property</string>