PHPStorm tips for power users

Written on 2018-03-15

A selection of less-known-yet-powerful features of PHPStorm.

Pane modes

Every pane in PHPStorm has several modes and can be configured either by hand or via key bindings.

  • docked: makes a pane not overlap with other panes or the code screen.
  • pinned: automatically hides a pane when not pinned.
  • floating: makes the pane float.
  • windowed: makes the pane a full-blown window.
  • split: to allow multiple panes in one area.

Working with non-pinned panes will allow for a much cleaner editor view. Binding certain panes to a key combination will show them at will.

Auto-imports

By default, PHPStorm will only auto-import namespaces if you're already in a namespaced file. Auto imports can be configured to also work in normal PHP files in Settings > Editor > General > Auto Import.

Code templates

You can change almost every template of auto-generated code in Settings > Editor > File and Code Templates For example: generate getters and setters without docblocks, generate test functions in another format and others.

--

String actions

When pressing alt + enter (Show Intention Actions) on a string, you'll get multiple useful actions. Things like replace quotes to toggle between single- and double quotes, split string to split the string, and more.

Copy paths

Two very useful commands:

  • Copy Paths to copy the full path to the current file.
  • Copy Reference to copy the relative project path and line number to the current file.

This "current file" can be the file you're editing, but could also be the selected file in the tree view or navigation bar.

Commands to toggle options

Instead of opening the settings to toggle options, there are a lot of toggles you can manage from the command palette. For example: show or hide the tabs bar.

You can open the command palette with ⌘ ⇧ A on the default Mac keymap. If you want to lookup the keybinding on your system: the command is called Find Action.

Custom JVM options

PHPStorm runs on Java, and there's a file in which you can specify extra options for the JVM to optimise performance. I've written about those options here.

Distraction free mode

Distraction free mode will hide all panes by default, but you can easily bring them back via the command palette or key bindings.

Besides this "no clutter by default", your code will also align more centered, which can be a much more pleasant reading experience. The width of this centered code view is configured in Settings > Editor > Code Style > Hard wrap at.

Color inspection

Do you want to know why a word is highlighted or change the colouring? There's a command called Jump to Colors and Fonts which will allow you to edit the color of your current scheme, for that entry.

Any more suggestions?

I'd love to hear your own tips on how to use PHPStorm. Feel free to let me know via Twitter or e-mail.

Things I wish I knew when I started programming

Things I wish I knew when I started programming cover image

This is my newest book aimed at programmers of any skill level. This book isn't about patterns, principles, or best practices; there's actually barely any code in it. It's about the many things I've learned along the way being a professional programmer, and about the many, many mistakes I made along that way as well. It's what I wish someone would have told me years ago, and I hope it might inspire you.

Read more

Comments

Loading…
No comments yet, be the first!
Noticed a tpyo? You can submit a PR to fix it.
HomeRSSNewsletterDiscord© 2025 stitcher.io