开发者

intellij idea macro grayed out

开发者 https://www.devze.com 2023-01-28 15:44 出处:网络
I\'ve just recorded a macro in IntelliJ Idea basically to record me typing <div c开发者_如何学运维lass=\"blah></div>

I've just recorded a macro in IntelliJ Idea basically to record me typing

<div c开发者_如何学运维lass="blah></div>

Then I clicked 'Stop recording', then named the macro. I see my named macro under Tools, but it is grayed out even though my cursor is on a HTML file. Anyone know why I can't use the macro?


It's recommended to use Live Templates for such tasks. As for the problem with Macro, we'll need more details like the sample project, IDEA version, your OS.


As CrazyCoder said use a template. For example:

<div class="$CLASS$">$END$</div>

Then Edit variables set CLASS expression to "blah" (including the double quotes).

Set abbrevation to div, and applicable contexts to html.

Then just type div Tab in an html file, edit the class name and Tab to end up between div tags.

0

精彩评论

暂无评论...
验证码 换一张
取 消