Tab performing editor indent rather than Emmet or Snippet


When I use Cmd+. to see what editor functions are mapped to a keypress I see the following list:


The situation is that I’m in an .html.erb file, I type a % and press tab expecting it to use my snippet of:

  'ERB Block':
    'prefix': '%'
    'body': '<% $1 %>'

But instead I get a % symbol followed by spaces to indent. If I use Cmd+Opt+P I get [“text.html.erb”] in the console.

Any ideas on what I’m doing wrong or if this is a bug?


I just ran a quick test using the img snippet in Markdown:

I then added the following to my snippets.cson:

    prefix: '%'
    body: '%test'

And it worked as expected. Do you have more than one section named .text.html.erb in your snippets.cson? If so, only the last one will “win”.


You’re a superstar! For some reason I didn’t consider the issue of having multiple sections (even though it’s obvious now I think of it).

Thanks, all working fine now!


While this isn’t exactly a common issue, this isn’t the first time this has come up (which is why I thought to ask :grinning:). Would you mind creating an Issue on the snippets package for a Deprecation Cop-like view that would pop up in situations like this?

I’m on my way to a meeting or I’d do it. I just don’t want it falling in the cracks.


No problem mate, done