Essential keyboard shortcuts you NEED to know when using PHP Storm

Essential keyboard shortcuts you NEED to know when using PHP Storm Thumbnail image


PHPStorm is a very popular IDE (Integrated Development Environment) for PHP, released by JetBrains. In my opinion it is the best IDE or text editor that you can find, if you use PHP.

I've been using it for many years, and although it occassionaly has a few very minor bugs or annoyances, it would be hard to find a better program to code in.

If you use Vim normally, you will be happy to know that there is a good Vim emulator plugin. It covers most (but not all) features, and normally works very well.

This is a basic guide to the most important keyboard shortcuts that you need to know when using PHPStorm.

The options panel is very comprehensive, and you can always assign custom keyboard shortcuts. There is also the very useful Key Promoter plugin that you can install - after you perform certain actions it'll show a small popup window saying what keyboard shortcut could have achieved the same action. It is a great way to learn some new keyboard shortcuts, which'll speed up your development time!

The super essential PHPStorm keyboard shortcuts to know

Apart from obvious things like copy (cmd/ctrl + c), paste (cmd/ctrl + v) etc, the following keyboard shortcuts are very important when you use PHPStorm and I really recommend you make good use of them!

Quick search ("Search Everywhere")

Win/Linux:shift, shift
Mac OS:shift, shift
Search everywhere in PHPStorm

The Search Everywhere popup is very useful! You can, unsuprisingly enough, search for anything here! Files, classes, objects, variabls, etc.

You can even search for PHPStorm settings:

Search for settings in PHPStorm

(I actually find that sometimes I have to press shift 3 times in a row to get it to popup)

Related shortcut: Search for classes:

Win/Linux: ctrl + o
Mac OS: ⌘ + O

If you know you are looking for a certain class file, then press Ctrl + O (⌘ + O on mac) and start typing what you are looking for.

Search for class in PHPStorm

Related shortcut: Search for file

Win/Linux:shift + ctrl + o
Mac OS:shift + ⌘ + O

Another related search function is shift + ctrl + o (or shift + ⌘ + O), which lets you search by filename. You can click the filter icon (blue in the screenshots) to filter by certain filetype.

Search for class in PHPStorm

Extend selection

Win/Linux:Ctrl + w
Mac OS:⌥ + up arrow

This is a very useful keyboard shortcut when selecting text. Press the shortcut and it will smartly expand the selection (from the narest quotes, to next 'block'). It is a little bit hard to explain, but check it out. It is an easy one to remember (especially the Mac OS shortcut of ⌥ and up arrow).

expand selection in phpstorm

Shrink selection

Win/Linux:ctrl + shift+ w
Mac OS:⌥ + down arrow

The opposite of extending selection is to shrink it.

View recent files

Win/Linux:ctrl + e
Mac OS: ⌘ + o
Recent files in PHPStorm

Use this to quickly switch between recent files. Type in a few characters of its name, and select what you want with the mouse or the arrow keys.

View recently edited file

Win/Linux:ctrl + shift + e
Mac OS: ⌘ + shift + o

Similar to the above "View recent files", but only show recently edited files

Recently edited files

Add comment

Win/Linux:ctrl + /
Mac OS: ⌘ + /
comment line in PHP storm

Use this keyboard shortcut to quickly and easily comment out lines (or a block, if more than one line is currently selected.

If a line is already commented then you can use the same keyboard shortcut to do the reverse.

Subscribe to my spam free newsletter for other Laravel and Vue updates like this

I never spam, and only email when I have a good in-depth post published on my site (mostly about Laravel and Vue). You can also follow me on social media to get updates.

webdevetc profile pic

I've been working as a software developer for many years (with the last few years specialising in Laravel and Vue). I mostly write about PHP and JavaScript/TypeScript on this site. Contact me here. Need to hire a contract software developer in London, UK (or freelance)? Contact me and check my availability.

Leave a Comment