0

The old Emmet work fined, but now my Sublime has upgraded Emmet plugin to the latest version automatically, and the following snippets doesn't work anymore...

The latest Emmet can only accept HTML syntax on custom snippets

These snippets my seems odd, since these are my custom tag which will be convert into php code in Template Engine, so the code aren't HTML syntax.

For instance, when I type p1 and press tab, I want it give me <!--{if }-->:

{
    "config": {
        // Configure snippets/options for HTML syntax only.
        // For a list of supported syntaxes, check out keys of `syntax_scopes`
        // dictionary of `Emmet.sublime-settings`
        "html": {
            "snippets": {
                "p1": "<!--{if }-->",
                "l1": "<!--{/if}-->",
                "p2": "<!--{loop }-->",
                "l2": "<!--{/loop}-->",
                "p3": "<!--{eval }-->",
                "p4": "<!--{block }-->",
                "l4": "<!--{/block}-->",
                "else": "<!--{else}-->",
                "elif": "<!--{elseif }-->"
            }
        }
    }
}

1 Answer 1

2

New Emmet accepts snippet values as Emmet abbreviations (yep, a recursion) and plays better with native ST snippets. Thus, you should either add your snippets as native in ST, or if you still want to use Emmet for such snippets, you should write them as valid Emmet abbreviation. To output arbitrary text in Emmet abbreviation, you should write it as text node, e.g. wrap with { and }.

So, your snippet should look like this:

"p1": "{<!--{if }-->}"

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

Comments

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.