How to add php syntax highlighting to a .theme file?


I’ve startet with drupal 8 and there are files with .theme extension. These files are always php code. Is there a setting, where i can say Atom to view .theme files like .php files?


@finkenmann: I invoked the command “Editor: Log Cursor Scope” (option + command + P) from the Command Pallet within a .php page to show the proper scope name that I was after. I then added the “customFileTypes” object, which assigns the ‘theme’ extension to the scope that I chose, within my “core” namespace in Atom’s config.cson (Atom->Config…). Save and reopen Atom, and you should now have PHP syntax highlighting for your .theme files.

core: customFileTypes: { 'text.html.php' : ['theme'] }


There’s now an entry in the Atom FAQ for this:



    customFileTypes: 'text.html.php' : ['theme']

This snippet worked for me, not other one.


The indentation is critical.