0

I have the following snippet:

<snippet>
    <content><![CDATA[
<label for="my-id">Name:</label>
<input type="text" id="my-name" name="my-name" value="enter your name" />
]]></content>
    <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
    <tabTrigger>htmlLabel</tabTrigger>
    <!-- Optional: Set a scope to limit where the snippet will trigger -->
    <scope>text.html</scope> 
    <description>Html Label and input</description>
</snippet>

It should be scoped to HTML. It's not there when I'm in C# or Plain Text but is IS there in Markdown.

0

1 Answer 1

2

There are two ways you can fix this issue:

  1. Change your scope to text.html.basic

  2. Change your scope to text.html -text.html.markdown

Markdown is just a shorthand syntax for HTML. The scope for markdown is actually just text.html.markdown. You have text.html specified as your scope, so all the children of text.html are going to have access to the snippet as well.

If you want to specify a snippet for only plain HTML, you have to specify that you only want text.html.basic (the first method I showed), or you can negate certain scopes by using the - symbol (the second method I showed).

Here is a good resource where you can see all of the different types of scope for Sublime.

Sign up to request clarification or add additional context in comments.

1 Comment

That probably answers a question I had on the Sublime Text forums as well. sublimetext.com/forum/viewtopic.php?f=3&t=20179

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.