2

I'm writing a snippet for html.erb files,
but I can't understead what should I write in scope tag.
When I press ctrl+shift+alt+p it shows to me "text.html.ruby text.html.basic"

html.erb

<p>test</p>
<%= 'test' %>

The snippet

<snippet>
    <content><![CDATA[test]]></content>
    <tabTrigger>test</tabTrigger>
    <scope>text.html.ruby</scope>
</snippet>

or

<snippet>
    <content><![CDATA[test]]></content>
    <tabTrigger>test</tabTrigger>
    <scope>text.html.basic</scope>
</snippet>

Doesn't work but it's all right with the snippet cuz when I change the scope to "source.ruby" all is working fine.

P.S correct my english.

Parki
  • 159
  • 9
  • This is not a ROR problem, but with html, take a look at [this](http://stackoverflow.com/questions/36129043/how-to-create-a-snippet-for-html-in-sublime-text/36129044#36129044) question. – Parki Mar 21 '16 at 10:54

1 Answers1

0

Correct tag for erb is:

<scope>text.html.ruby</scope>

You problem in content section, because tabTrigger "test" will be replaced by same value "test". There should be something like this:

<snippet>
    <content><![CDATA[<%= ${1:test} %>]]></content>
    <tabTrigger>test</tabTrigger>
    <scope>text.html.ruby</scope>
</snippet>
Vovanches
  • 11
  • 4