Boost Productivity with PhpStorm: Essential Shortcuts and Tricks
Overview
PhpStorm is a feature-rich PHP IDE that speeds development through intelligent code assistance, debugging, and integrations. Below are high-impact shortcuts and practical tricks to boost productivity immediately.
Essential Shortcuts (Windows/Linux — Mac)
| Action | Windows/Linux | Mac |
|---|---|---|
| Find action | Ctrl+Shift+A | ⌘⇧A |
| Search everywhere | Double Shift | Double Shift |
| Go to class/file/symbol | Ctrl+N / Ctrl+Shift+N / Ctrl+Alt+Shift+N | ⌘O / ⌘⇧O / ⌥⌘O |
| Navigate to declaration | Ctrl+B / Ctrl+Click | ⌘B / ⌘Click |
| Recent files | Ctrl+E | ⌘E |
| Recent locations | Ctrl+Shift+E | ⌘⇧E |
| Run | Shift+F10 | Ctrl+R |
| Debug | Shift+F9 | ⌃D |
| Step over / into / out | F8 / F7 / Shift+F8 | F8 / F7 / ⇧F8 |
| Toggle breakpoint | Ctrl+F8 | ⌘F8 |
| Rename refactor | Shift+F6 | ⇧F6 |
| Refactor menu | Ctrl+Alt+Shift+T | ⌃T |
| Reformat code | Ctrl+Alt+L | ⌥⌘L |
| Optimize imports | Ctrl+Alt+O | ⌥⌘O |
| Auto-complete | Ctrl+Space (basic) / Ctrl+Shift+Space (smart) | ⌃Space / ⌃⇧Space |
| Surround with | Ctrl+Alt+T | ⌥⌘T |
| Multi-cursor | Alt+J / Ctrl+G | ⌥J / ⌃G |
| Duplicate line | Ctrl+D | ⌘D |
| Delete line | Ctrl+Y | ⌘Backspace |
| Quick documentation | Ctrl+Q | F1 |
High-value Tricks
- Live Templates — Create snippets for common boilerplate (controllers, tests). Use Settings → Editor → Live Templates and assign abbreviations.
- Structural Search & Replace — Make complex refactors safely by searching code patterns (Edit → Find → Search Structurally).
- File Watchers — Auto-run tools (e.g., linters, preprocessors) on save to keep code validated and compiled.
- Database tools — Connect to databases directly in PhpStorm to run queries and inspect schemas without leaving the IDE.
- Integrated Terminal & Composer — Use the built-in terminal and Composer tool window for package management and scripts.
- Run Configurations & Compound Runs — Define multiple run/debug configurations and run them together for integration testing.
- Code Analysis & Inspections — Enable PHP CodeSniffer, PHPStan, or Psalm integrations and fix issues via Alt+Enter quick-fixes.
- Local History — Recover lost work without VCS via right-click → Local History → Show History.
- Favorites & Scope-based Bookmarks — Use bookmarks (F11) and Favorites to quickly access frequently edited files or project areas.
- Use Power Save Mode selectively — Disable inspections temporarily for heavy refactors to reduce lag (File → Power Save Mode).
Tips for Faster Debugging
- Configure Xdebug with correct max_nesting_level and path mappings.
- Use “Evaluate Expression” during breakpoints to inspect and modify variables.
- Enable “Force return” to exit methods early for rapid flow testing.
- Use conditional breakpoints and log expressions instead of pausing for noisy loops.
Customization for Speed
- Assign your own keymap or tweak existing shortcuts (Settings → Keymap).
- Disable unused plugins to reduce startup time.
- Increase memory heap if project is large (Help → Change Memory Settings).
Quick Routine to Save Time (daily)
- Open Recent Files (Ctrl/Cmd+E) to jump back into work.
- Run inspections for changed files (Ctrl+Alt+Shift+I) and fix via Alt+Enter.
- Use Live Templates for test and class scaffolding.
- Run unit tests via gutter icons or Run configurations.
- Push using integrated Git (Alt+9) with commit templates.
Resources
- PhpStorm keymap reference (built-in) and JetBrains blog for new features.
If you want, I can generate a custom set of Live Templates or a printable cheat sheet for your OS.
Leave a Reply