Search code examples
phpideeditorphpstorm

How to record macro in PhpStorm?


Currently I'm using PhpStorm and I want to make a macro like this:

echo "<pre">;
var_dump(**paste last copied value here**);
die;

Solution

  • You can record a macro by using Edit | Macros | Start Macro Recording.

    You will have to type that all text manually and use clipboard as you would normally do. When finished recording you can assign custom shortcut to the freshly recorded macro and use it where needed.

    https://www.jetbrains.com/help/phpstorm/using-macros-in-the-editor.html


    But I do not think that you actually need a macro here.

    What you most likely need is code snippets .. which called Live Templates in IDEA-based IDEs -- it can work with clipboard content as well.

    Once you create such Live Template .. you just type its' abbreviation in the text, hit the expand key (Tab should be the default one) and it will insert that code snippet instead.