This has to be something not already being used or that might interfere with PHPStorm’s helpful suggestions. In the area at the bottom, give your template an abbreviation name: vdd. With the PHP heading highlighted in the Live Templates settings, click on the green “+” symbol on the right. We’re going to create an abbreviation for this: 1 OK - I know what you are thinking: How do I get on the band wagon and create my own examples? As you might expect, this is pretty simple too so let’s implement something that is often done when brute-forcing debugging. Try expanding that abbreviation outside of a class and it just won’t do anything. Can you start to imagine how much more free time with your loved ones you will generate by doing that several million times? The interesting thing to note is that the IDE is context aware. Pretty handy but not that impressive since you’ve only saved typing a few keystrokes. Open up a new PHP file in the IDE and type the following: 1Įven better, it places the cursor between the quotes. Quite a choice, right? Let’s play with one now. Now click on Editor > Live Templates and expand the PHP section. To begin, start by going to File > Settings or press Ctrl-Alt-S to bring the settings screen up. Fancy a look at what’s there? Let’s focus on PHP for this tutorial but as you will soon see, there are many other languages and options.
#Phpstorm live templates code#
Fortunately, PHPStorm has a lovely feature which will allow you to use abbreviations for common code elements, called Live Templates.
Saving keystrokes is not to be sniffed at when your fingertips and time are so precious.