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

Asked

Viewed 332 times

6

I like to use sublime text to develop some things in php. But there’s one thing that hasn’t been implemented yet.

When I create a trait, the sublime text 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 in sublime?

problema com a marcação da palavra trait

  • 1

    I don’t think there’s a solution to that yet. See: http://sublimetext.userecho.com/topic/100149-php-54-short-array-syntax-highlight-in-functions/ But I may be mistaken, let’s see if someone doesn’t show up with a.

1 answer

3


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

Sublime Text 3

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.