Basics
ALT-A | Show only your code |
Navigation
CTRL-⬆️ / CTRL-⬇️ | Move cursor from method to method |
CMD-SHIFT-MINUS | Collapse entire class (all code) |
CMD-PLUS | Expand one level of code |
CMD-SHIFT-PLUS | Expand all code |
ALT-J | Select next occurrence |
ALT-SHIFT-J | Select all occurrences |
ALT-ALT (hold second) ⬆️ / ⬇️ | Add multiple cursors without the mouse |
ALT-SHIFT-⬆️ / ⬇️ | Move code up or down |
Git
CMD-9 | Show/Hide Git Window |
CTRL-SHIFT-G + ⬇️ | Pull |
CTRL-SHIFT-G + ⬆️ | Push |
CTRL-SHIFT-G + F | Fetch |
CTRL-SHIFT-G + A | Toggle annotations |
Refactoring
CTRL-SHIFT-E + CTRL-SHIFT-M | Extract Method |
Testing
CMD-SHIFT-T | Toggle between class and tests |
CTRL-SHIFT-R | Run Test |
CTRL-SHIFT-S + C | Show Coverage Data |
CTRL-SHIFT-H + C | Hide Coverage Data |
Live Templates
lio | Log::shouldReceive(‘info’)->once(); |
leo | Log::shouldReceive(‘error’)->once(); |
pubt | /** @test */ public function () { } |
pubf | public function () { } |
prif | private function () { } |
msr | $mock->shouldReceive(”) ->once() ->andReturn(); |
msrt | $mock->shouldReceive(”) ->once() ->andThrow(); |
Creating / Editing Live Templates
- CMD-comma to enter Preferences
- Search for Live Templates
PHPStorm Shortcuts For Mac