If you can write a heuristic that can reliably tell the difference between plain HTML, Antlers and EJS, then you could conceivably add some code to your init.coffee
that would do this. The edge cases for this kind of thing are pretty hard though. For example, is the following an HTML, Antlers or EJS file?
<html>
</html>
By the nature of HTML templating languages, it could conceivably be any one of the three. Another example:
<html>
<body>
<p><%= (new Date()).toString() %> - Here are some {{ antlers }}</p>
</body>
</html>
At least we know that this one is either EJS or Antlers.
I also recently wrote about the difficulty of writing a reliable heuristic for determining if a chunk of text was Markdown or not.
People generally don’t like it when computers try to guess what they want and get it wrong. So it is often better to do the simple, dumb thing than to try to do the smart thing and guess wrong even a fraction of the time. This is why Atom checks the file extension and looks at the first line of the file (mostly for shebang lines) to determine the grammar to use.
With that said, I would love it if someone ported Linguist over to Atom for these kinds of things. Even still, it would just use the file extension the vast majority of the time.