How do I make the sublime text mark a word as a keyword?

6

I like to use the sublime text to develop some things in php. But there is one thing that has not yet been implemented.

When I create a trait , sublime text does not "color" the keyword trait as expected.

How can I make the sublime text mark the words below as keywords?

insteadof , trait , callable

Is there a PHP 5.4+ package to install on the sublime?

    
asked by anonymous 14.07.2015 / 18:51

1 answer

3

It's relatively simple. You can edit the current PHP syntax package and include the reserved words. Syntax definition files have, by default, the .tmLanguage extension. You need to locate and change them.

Sublime Text 3

Locate the native packages installation directory. By default, you can find it on Linux in /opt/sublime-text/Packages . Locate the package for PHP, probably PHP.sublime-package . You may need to give permission to modify the files. .sublime-package files are just zipped files with a different extension. You should be able to unpack them normally. Open the file PHP.tmLanguage and insert into the set of regular expressions for the keywords the new keywords . Save it and recompile it, restore its extension and restart the editor.

    
31.07.2015 / 04:51