PhpStorm has an excellent debugger for developing Drupal modules or even Drupal themes. After numerous IDE and text editors, it has earned it's place to be my primary IDE for almost anything Drupal, for many good reasons. PhpStorm, by default, is as Drupal friendly as many other PHP IDEs. That means it gets the job done, but there might be some syntax in your code the Drupal Coding Standards and it's authors wouldn't be too happy about. Here are a few things to make PhpStorm play well with Drupal.
Althought not related to Drupal, the Keymap is the first thing we will change. PhpStorm by default comes with very unaturally keyboard shortcuts for me. Under Preferences, scroll down to select Keymap on the left. Select the keymap that suits your needs. Mac OS X 10.5+ feels the most intuitive to me. You may also further customize the keyboard shortcuts to each of the actions.
Now let's fix the code style. Drupal recommends less than 80 characters per line.
I have left the "Wrap when typing reaches right margin unchecked to prevent auto text wrap, since more than 80 characters is allowed for some situations. This gives you a nice solid line in the editor where 80 characters is.
Then we will work on PHP syntax. PhpStorm conveniently comes with a predefined style for Drupal, we will use that to start.
The "Tabs and Indents" should look like this.
On the "Spaces" tab, make sure "After type cast" is selected.
On the "Wrapping and Braces tab", make sure these settings are set correctly.
On the "Other" tab, convert True/False and Null to Upper case
That should be all we need for the PHP syntax. You might also want to set up syntax for other languages like HTML, JavaScript, CSS and any CSS preprocessors you may use.
I like to install the PHP CodeSniffer to give myself extra warnings about some Drupal Coding Standards violations. First of all, follow these instructions to install PHP CodeSniffer and the Drupal coding stands definitions. Once you have phpcs ready, set up the Code Sniffer like so
Make sure that PhpStorm is using the PHP Code Sniffer for code inspection.
Now you should get some nice warnings as reminders for keeping up the coding standards
If font size changing is not something you often do, I would also recommend turning off the mouse wheel zoom. I noticed a lot of accidental zooming happening under OSX using a Magic Mouse with the option turned on. I end up using Pinch-to-Zoom on the trackpad when I need zooming. You can also set up your own keyboard shortcut under Keymap in Preferences.
The debugger is my main reason for using PhpStorm for Drupal development. Follow this article to set up the debugger with Xdebug.