Skip to Main Content

Automatically Add Comments with Emmet

I previously wrote about using ExpressionEngine Snippets with Emmet. Unfortunately I haven't been able to solve the issue of getting ExpressionEngine code blocks to work with Emmet after it mysteriously stopped working. I have however continued to use Emmet for regular HTML and Javascript.

I previously wrote about using ExpressionEngine Snippets with Emmet. Unfortunately I haven't been able to solve the issue of getting ExpressionEngine code blocks to work with Emmet after it mysteriously stopped working. I have however continued to use Emmet for regular HTML and Javascript.

I like to have closing comments on most of my tags and starting thinking that it would be great if Emmet would also add the closing tags. Of course someone else, Christoper G. Herbert, also had this idea and posted about it here.

The steps are copied here: In Sublime Text go to Preferences > Package Settings > Emmet > Settings - User and add the following:

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

Also add/modify the following

    
      "syntaxProfiles": {
// Enable XHTML dialect for HTML syntax
// "html": "xhtml"
"html" : {
"filters" : "html, c"
}
}
    
  

You could also get a copy of Christopher's Emmet preferences at this paste bin.+

Atom Editor

The instructions for how to do this in Atom Editor are on stack overflow.