How can I modify the default Emmet comment?

In a nutshell: when typing this:

#id-name.class-name

upon hitting Tab, the default Emmet behavior is outlined in the screenshot below in YELLOW. However, I need Emmet to expand it into what's outlined in RED)

To be more specific:

  • (1) The HTML element must be split into 3 lines, with the inner one being indented
  • (2) The comment that comes by default on the next line after the element's closing tag, must be placed immediately after the closing tag, and NOT on the next line
  • (3) The extra slash (/) character included by default in the comment must be gone

I am aware of the fact that this kind of modifications cannot be simply achieved by modifying PhpStorm's settings in the UI, but I know the IDE's (or perhaps Emmet's?) configuration files (XML/JSON etc.) can still be modified, if one knows how to safely do it. This is why I'm hoping somebody more knowledgeable than me could point me into the right direction.

I'd highly appreciate any help.

6 comments
Comment actions Permalink

well, this is the way the Emmet Comment filter works... Just type #id-name.class-name|c in the preview window at https://docs.emmet.io/filters/#filters:

the result is

 

there is no way to alter this in the IDE

0
Comment actions Permalink

Hello Elena,

 

Thank you for taking the time to look into this. I completely understand that the IDE offers no way of altering the Emmet behavior, but what I was hoping for, was a way for me to change it manually. As per this solution on StackOverflow, in Visual Studio Code the Emmet preferences can be altered by modifying the settings.json file. I'm not a Java developer by any means, but I strongly believe there must be a similar way to achieve it in PhpStorm. Please correct me if I'm wrong :)

0
Comment actions Permalink

There is no way to modify Emmet filters behavior in WebStorm, sorry

0
Comment actions Permalink

Apologies if I wasn't clear enough. And by the way, I have no idea how my post ended up in the WebStorm discussions category. My question is related to PhpStorm, not WebStorn.

I was able to find two older posts referring to the same issue. The first post never got any replies, but the second one did. I don't want to sound offensive, apologies if I do, but I strongly believe that, by having more granular control over Emmet's default output in certain scenarios (such as the one described by me, but not only) would greatly speed up a developer's work. I would, therefore, appreciate any solution for it. If not immediately, then definitely in a future version of PhpStorm. Maybe that could be something for the PhpStorm development team to take into consideration? :-)

 

I highly value your patience and understanding on the matter. Thank you so much, Elena!

0
Comment actions Permalink

>And by the way, I have no idea how my post ended up in the WebStorm discussions category. My question is related to PhpStorm, not WebStorn.

 

WebStorm is a host project for HTML/Emmet support, that's why the post was moved here

 

>Maybe that could be something for the PhpStorm development team to take into consideration? :-)

 

please feel free to file a request for this feature to youtrack, https://youtrack.jetbrains.com/issues/WEB

1
Comment actions Permalink

That makes sense. Thank you for clarifying that for me.

On a side note, I filled in a feature request as per your suggestion here.

0

Please sign in to leave a comment.