Tuesday, 15 March 2011

Shortcut to insert code fragment in PhpStorm -


I want to shortcut to insert some code snippets, for example Ctrl + Shift + ] should include "$ this->" at the location where the cursor is.

I know about live templates but they are not shortcuts, it works like code compliance, so I need to insert some text, and then I have to choose a template from the context menu It's good for big code pieces, like foreach loops, but it's like a shortcut for a very common and small code piece like '$ the->' id.

As LazyOne suggested in the comment, such things can be easily done with macros: Assign a shortcut to macros, type codes, macros saved, macros created for macros.


No comments:

Post a Comment