Reputation: 11
How can I auto generate some common attribute like id
or class
for specific tags (like <p>
or <div>
) in PhpStorm?
PhpStorm doing this for some necessary attribute (like href
for <a>
) but I want to customize it for myself.
Upvotes: 0
Views: 70
Reputation: 93728
You can create your custom Live Templates for this, like:
Typing div
and hitting Tab
will result in adding <div id=""></div>
to your code.
Or, you can just use Emmet abbreviations: #id
+ Tab
expands to <div id="id"></div>
, .cls
+ Tab
- to <div class="cls"></div>
, p#id
+ Tab
to <p id="id"></p>
, etc.
Upvotes: 3