Productivity with PHPStorm

By | 25/09/2011
Since there are a lot of people out there working with PHPStorm I thought I try to write an article about how I try to get the maximum productivity out of this IDE. Also I have the hope that there are some other people out there who have some good tips for me.

Here I just want to show my favorite shortcuts and I want to explain how I try to learn new shortcuts each day. This are just my favorite shortcuts. There are so many more like search for classes, methods and files, navigating between open editor windows. And more, and more, and more……

  1. Shortcuts
    1. QuickJump (Plugin)
      Just learned about this plugin some a day ago and since that, I am using it all the time. It is a really easy way to navigate from one piece of code to another. Check out http://plugins.intellij.net/plugin/?webide&id=6311 or take a look at the video on: http://johnlindquist.com/2011/09/12/intro-to-the-quickjump-plugin/
    2. KeyPromoter (Plugin)
      Good for learning short cuts. Each time you use the menu or the mouse for a function that is available via a shortcut, your IDE will tell you.
    3. Complete Statement (Ctrl+Shift+Enter)
      There is a really good auto-complete in PHPStorm. But if you use the auto-complete and call a function e.g., than you got stuck between your brackets where your entered your parameter from time to time. To leave the brackets and add the semicolon at the end of the call, press Ctrl+Shift+Enter
    4. Last edit location
      Edited some code and moved on to another part of the code to look something up? Now you to scroll back where you made your last change? You don’t need to, just hit Ctrl+Shift+Backspace to jump to your last edit location, even through multiple files.
    5. Bookmarks in your file
      This is interesting if you now that you have to work on two or more parts on your code and that you want to jump between this places. Set a bookmark and jump.
      Ctrl+Shift+<number> to set, Ctrl+<number> to jump there
  2. Search in each window directly
    There is a search function in all windows. For example, if you are in the structure view, and you now this function somewhere in t3lib_div, click anywhere in the structure view and start typing the name of the function you search. You can also open the structure view by using Alt+7
  3. LiveTemplates
    I use live templates mostly for fluid. I created live templates for the most common fluid snippets and if I have to add a form for example, I just use the shortcut for live templates and start tipping form and select my fluid form. Now I only have to enter the data like action and controller.
  4. FileTemplates
    I also added a couple of FileTemplates, mainly for Extbase and Fluid files that automatically set the correct namespace and author. I have some examples, perhaps they are out of date, on my web page: http://www.layh.com/work/flow3-fluid/flow3/file-templates-for-phpstorm.html

Also if you start up your IDE, you will get a Tip-of-the-day. Sometimes I think it is bullshit and I turn it of, but why not see this message ones a day and try to use this promoted shortcut throughout the day. There are some really useful tips.

There is a keyboard reference on the Jetbrains website: http://www.jetbrains.com/phpstorm/documentation/index.html . But for me, this document is way to much and written to small to have a short look. So I took the most important short cuts from this reference and added them to file, printed this out in large and put it on my desk to always have the shortcuts in front of me. From time to time I change this a little bit to learn some new shortcuts and to remove the shortcuts I already learned.

As an additional resource I can recommend the PHPStorm blog. They have some good tips from time to time. http://blog.jetbrains.com/webide/

Hope I could help someone to be more productive and to have more fun with your favorite IDE. I am also look forward to your comments and hints.