Sublime Forum

PHP variables highlighting

#1

Hello,
I’m new to sublime text and I’m trying to get php variables to have a different color so they’re differentiated from methods and functions.
I tried installing AAAPackageDev Package and made a file with this as content

[code]# [PackageDev] target_format: plist, ext: tmLanguage

name: PHP Variables
scopeName: source.php
fileTypes: [php]
uuid: 0711a904-60ef-4c6a-930d-179075a0bcac

patterns:

  • comment: Variables like $PARAM1, $TM_SELECTION…
    name: keyword.other.php
    match: $([A-Za-z][A-Za-z0-9_]+)
    captures:
    ‘1’: {name: constant.numeric.php}[/code]

But when I convert the file to .tmLanguage and restart the text editor it I get this result: prntscr.com/5k5ruo

Any idea what I should do ?

0 Likes

#2

Check if you selected the correct syntax. There is no way the above syntax would generate your outcome.

Works for me: (http://i.imgur.com/zFNXGgY.png)

0 Likes

#3

are you using Sublime Text 3 too ?

0 Likes

#4

Yes (just as everyone should).

0 Likes