Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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;
like image 814
vishal ribdiya Avatar asked Dec 17 '25 06:12

vishal ribdiya


1 Answers

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.

  • https://confluence.jetbrains.com/display/PhpStorm/Live+Templates+%28Snippets%29+in+PhpStorm
  • https://www.jetbrains.com/help/phpstorm/live-templates.html
like image 63
LazyOne Avatar answered Dec 20 '25 00:12

LazyOne