Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change color of the class properties in Sublime text 2?

Currently this is the code that highlights all variables, including class properties (they are red):

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

How can I change the color of class properties only?

$object->property = 'xxx';

so $object should still be red, but I want property in a different color

like image 636
Alex Avatar asked May 31 '12 11:05

Alex


People also ask

How do I change the Color Scheme in Sublime Text?

To create a user-specific customization of a color scheme, create a new file with the same filename as the color scheme, but save it in the Packages/User/ directory. For example, to customize the default Monokai color scheme, create a file named Packages/User/Monokai. sublime-color-scheme.

How do I find the color code in Sublime Text?

Once installed, go to the Command Palette in Sublime Text by hitting the Command + Shift + P or (Ctrl + Shift + P for Windows). Then search for ColorPicker. Or you can do it faster just by pressing Command + Shift + C. This will open the native color picker from your OS.

How do I change the highlight color in Sublime Text 3?

Changing the selection colour in Sublime Text 3Open the command palette with ⌘+⇧+P on mac iOS (for windows/linux Ctrl + Shif + P) and type prv to get the PackageResourceViewer options. Choose Open Resource >> Color Scheme – Default >> and choose your theme file to edit.


2 Answers

variable.other.property should do the trick:

<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>
like image 62
bjauy Avatar answered Oct 04 '22 05:10

bjauy


Change:

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

To:

<string>variable.other.property</string>
like image 23
Farhan Ahmad Avatar answered Oct 04 '22 05:10

Farhan Ahmad