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?
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
Use filters:
div>div#page>p.title+p|c
Reference: http://docs.emmet.io/filters/
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}
If you also want to have some text inside the div, you can use the following:
div.container{Hello World}+c>{custom comment}
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With