How to write a comment with Emmet plugin in Sublime?
Asked Answered
H

4

13

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?

Hudgins answered 8/9, 2013 at 18:57 Comment(1)
docs.emmet.io/filters/#comment-tags-cHubbell
C
16

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

Cephalization answered 30/6, 2015 at 20:57 Comment(0)
A
1

Use filters:

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

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

Artemisa answered 31/3, 2016 at 19:23 Comment(0)
F
1

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

Favrot answered 21/8, 2021 at 6:42 Comment(0)
G
0

I believe this is what you're looking for:

c{test}+div>p{Comments!}^c{/test}

Guyette answered 3/3, 2020 at 22:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.