Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write a comment with Emmet plugin in Sublime?

Im using sublime 2 with Emmet plugin. Is there a way to write a comment with speed coding that would produce me something like that:

<div class="container">
   Lorem ipsum
</div> <!-- custom comment -->

I've tried

div.container

And it's not working.

Is it possible to add comments to each div or element created via speed coding snippets?

like image 290
Menci Avatar asked Sep 08 '13 18:09

Menci


3 Answers

You can write quick comand c+tab for simple comment or you can write in this form c{my comment}+tab to add text into de comment tags

like image 84
Endika Llonin Avatar answered Oct 08 '22 17:10

Endika Llonin


Use filters:

div>div#page>p.title+p|c

Reference: http://docs.emmet.io/filters/

like image 39
Jorge Cedi Medina Avatar answered Oct 08 '22 17:10

Jorge Cedi Medina


c>{some comment} will give you a comment with text "some comment" in it.


To have a comment after a div, you can use the following:

div.container+c{custom comment}

enter image description here


If you also want to have some text inside the div, you can use the following:

div.container{Hello World}+c>{custom comment}

enter image description here


If you want to have something after the comment, you need to group it using brackets as shown below:

div.container{Hello World}+(c>{custom comment})+div#nav

enter image description here

like image 1
Anonymous Panda Avatar answered Oct 08 '22 16:10

Anonymous Panda