How to insert html comment with autocomplete?

In PHPStorm 2016: Is it possible to enter a character and press space or tab and have a html comment entered automatically by autocomplete: <!--    --> with a few spaces inside?

0

Hi there,

You can create custom Live Template for that with any convenient for you abbreviation

https://www.jetbrains.com/help/phpstorm/2016.3/startup-tasks.html?search=startup

 

P.S.

From what I see, the "c[TAB]" Live Template (where [TAB] is the expand shortcut -- could also be [Space] or [Enter] -- depends on your settings)  is already provided by default (at least in latest 2016.3.2 version)

1

After a bit of searching I found a Live Template named "c(<!-- -->)" in Settings->Live Templates->Zen HTML.

But now I need to find existing template which is currently responsible for changing "div.my-class" into "<div class="my-class"></div>". Could you tell where in the Live Templates tree it exists? My aim is to modify it somehow to add the HTML comment with class name after the closing div tag, like you said it was possible in this thread.

0

>After a bit of searching I found a Live Template named "c(<!-- -->)" in Settings->Live Templates->Zen HTML.

That's exactly what I meant by "c[TAB]" Live Template (you type "c" in editor and press TAB key -- it will expand that Live Template)

 

>find existing template which is currently responsible for changing "div.my-class" into "<div class="my-class"></div>"

It's not live template. Live Template works with static abbreviations only -- this one is dynamic.

This code/such expansion is created by Emmet :

Check this StackOverflow answer -- it shows how to enable such Emmet option: http://stackoverflow.com/a/37067602/783119

1

请先登录再写评论。