Using multiple language modes in one opened buffer


Hi everyone,

I was using Coda for a very long time and I really liked the feature to have a combined language mode for HTML, PHP, jQuery and CSS. Now Im curious if this can be accomplished by Atom. Any ideas on how to do this?



There was a discussion on a similar topic here:

As for combining languages it’s always possible to create a higher syntax that compose all the languages you want to handle, or modifying a language to start including a new sub-language.


Thanks abe, but I still don’t know how to use (if it can be used at this moment) or how to create higher level syntax modes to combine multiple ones.

Any ideas/clues?


You can start with the official documentation on creating packages (which include themes and grammar):

You can also probably take a look at how the php and html grammar are defined. I guess the php grammar may already handle what you want, but maybe not, in that case you can always submit a PR with your changes or fork the project.