Mahdi Ahmadi
Mahdi Ahmadi

Reputation: 11

How to customize auto generate attribute in PhpStorm?

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

Answers (1)

lena
lena

Reputation: 93728

You can create your custom Live Templates for this, like:

enter image description here

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

Related Questions