Bangash Bangash - 20 days ago 9
HTML Question

Emmet closing div's comment should come at the same line, how?

When I type

.container|c
and press tab, I need the result as;

<div class="container">

</div> <!-- /.container -->


Not as;

<div class="container">

</div>
<!-- /.container -->


Is there any way to change this behavior ? (I'm using Emmet inside brackets), I need the closing div's comment at the same line as the closing tag, not at the new line, because sometimes accidentally I add more content in between the closing div tag and the comment.

Answer

Add the following to your Emmet User settings in Sublime Text (menu option Preferences > Package Settings > Emmet > User - Settings):

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

Source:

http://iaintnoextra.tumblr.com/post/68089741466/automatically-add-closing-comments-to-html-using

Comments