2012-05-31 105 views
7

目前,這是一個突出的所有變量,包括類屬性(它們是紅色)代碼:如何在Sublime text 2中更改類屬性的顏色?

<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以不同的顏色

回答

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> 
+0

樣的作品,但它也改變了一些其他類型的關鍵字.. – Alex

+0

@Alex:你可以提供什麼其他類型的關鍵字的改變,以及一個例子嗎? –

+0

好吧,它也突出像'$ this - > $ something'這樣的變量。 $東西應該像普通變量一樣突出顯示,因爲這就是它的原因 – Alex

1

變化:

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

至:

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