Daniel Santarriaga
Daniel Santarriaga

Reputation: 60

filter.commentAfter by Emmet in Sublime Text 3 not work

In Emmet by ST3, I tried to customize a little comment after giving tab when creating a label, for example #div or .span

I read that this was a solution in the settings of Emmet (Emmet.sublime-settings):

"preferences": {

    "filter.commentAfter"  : "<!-- <%= attr('id', '#') %> <%= attr('class', '.') %> -->",

    "filter.commentBefore" : "<!-- <%= attr('id', '#') %> <%= attr('class', '.') %> -->"
}

But not work. Please Help

Upvotes: 0

Views: 743

Answers (1)

Mihai Vilcu
Mihai Vilcu

Reputation: 1967

In your User/Emmet.sublime-settings file make sure you have your structure like this

{
    "preferences": {
        "filter.commentAfter"  : "<!-- <%= attr('id', '#') %> <%= attr('class', '.') %> -->",
        "filter.commentBefore" : "<!-- <%= attr('id', '#') %> <%= attr('class', '.') %> -->"             
     }
}

and it should work.
Make sure you dont forget about the |c at the end

div#test.myclass|c

As an extra if you want to automatically add the c filter you should set your syntaxProfiles to something like this

{
    "preferences": {
    },
    "syntaxProfiles": {
        "html" : {
            // auto add the comments
            "filters": "html,c"
        }
    }
}

make sure it's on the same level as preferences

Upvotes: 3

Related Questions