Can you please share some useful and easy to use shortcuts (live templates and keymaps, maybe even some plugins) for PHPStorm program?
Thanks
GENERAL & EDITING:
CTRL + ALT + S
- Opens Settings dialog
CTRL + SHIFT + A
- Find Action - find any action inside the PhpStorm
CTRL + ALT + L
- Reformat code
CTRL + W
- Select code blocks - quickly select any block of code without using the mouse
CTRL + SHIFT + W
- Decrease current selection to previous state
CTRL + D
- Duplicate current line or selected block
CTRL + Y
- Delete line wherever the caret is located
ALT (holding) + CLICK
- Multiple cursor
CTRL + SHIFT + UP
- Moves the line up
CTRL + SHIFT + DOWN
- Moves the line down
SHIFT + ENTER
- Start a new next line wherever you are in the project
CTRL + Q
- Quick documentation lookup
CTRL + MOUSE OVER
- Code Brief Info
CTRL + DEL
- Will delete the word AFTER the cursor
CTRL + BACKSPACE
- Will delete the word BEFORE the cursor
CTRL + NUMPAD+
- Expand code block
CTRL + NUMPAD-
- Collapse code block
CTRL + /
- Comment/uncomment line
CTRL + SHIFT + /
- Comment/uncomment block
SHIFT + F6
- Renaming the variable (refactor/rename)
CTRL + TAB
- Switch between tabs and tool window
CTRL + SPACE
- Basic code completion
ALT + ENTER
- Show intention actions and quick-files
CTRL + P
- Parameter info (within method/function call arguments). Place the caret anywhere within the call of the desired method or function and press Ctrl+P for more info.
ALT + INSERT/F12
- Generate code... (Getters, Setters, Constructors)
CTRL + O
- Override methods
CTRL + I
- Implement methods
ALT + F2
- Open the page in browser
CTRL + ALT + T
- Surround with... (if..else, try..catch, for, etc.)
CTRL + ALT + I
- Auto-indent line(s)
CTR + SHIFT + U
- Changes the text - lowercase or UPPERCASE
CTRL + ALT + J
- Surrounds with a live template or EMMET
CTRL + ] / [
- Move to code block end/start
CTRL + SHIFT + ] / [
- Select till code block end/start
CTRL + F4
- Close active editor tab
CTRL + SHIFT + V
- Paste from history
ALT + #[0-9]
- Open corresponding tool window
ALT + 1
- Opens/closes the navigation/tool bar (usually on the left)
CTRL + ALT + F11
- Toggle full screen mode
CTRL + SHIFT + F12
- Toggle maximizing editor
ALT + SHIFT + F
- Add to Favorites
ALT + SHIFT + I
- Inspect current fie with current profie
CTRL + SHIFT + J
- Smart line join (HTML and JavaScript only)
CTRL + ENTER
- Smart line split (HTML and JavaScript only)
CTRL + SHIFT + ENTER
- Complete a statement
CTRL + SHIFT + I
- See (peek in modal/popup window) CSS/JS/PHP properties on hover of a class in HTML/JS/CSS/PHP files. (very useful for WordPress development 🙂
NAVIGATION:
CTRL + SHIFT + A
- Find Action - find any action inside the PhpStorm
CTRL + N
- Go to class
CTRL + ALT + SHIFT + J
- Select all occurrences of current word/symbol in multiple caret mode
ALT + J
- Select all occurrences of a particular (current) word/symbol by choosing them one by one (one after another)
CTRL + SHIFT + N
- Go to file
CTRL + G
- Go to line
CTRL + SHIFT + BACKSPACE
- Navigate to the last editted location in the project
ALT + LEFT
- Previous tab
ALT + RIGHT
- Next tab
CTRL + ALT + SHIFT + N
- Go to symbol
ESC
- Go to editor (from tool window)
CTRL + E
- Recent files popup
CTRL + ALT + LEFT/RIGHT
- Navigate back/forward
ALT + F1
- Select current fie or symbol in any view
CTRL + ALT + B
- Go to implementation(s)
CTRL + SHIFT + I
- Open quick defiition lookup. Shows the related properties of the HTML id/class from CSS or for a function - shows in a pop-up window
CTRL + SHIFT + B
- Go to type declaration
CTRL + U
- Go to super-method/super-class
ALT + UP/DOWN
- Go to previous/next method
F2 / SHIFT + F2
- Next/previous highlighted error
F4 / CTRL + ENTER
- Edit source / View source
CTRL + B OR CTRL + CLICK
- Go to declaration. You can instantly jump to the function or method definition or a variable, class, component, or CSS style declaration: just Ctrl-click on it, or place the caret on it and press CTRL + B. This shortcut can also help you jump to the referenced file or imported module.
FN + END BUTTON
- Goes to the bottom of the page
SEARCH & REPLACE:
DOUBLE SHIFT (SHIFT+SHIFT)
- Search everywhere - inlcuding files in the whole project
NOTE: it does not search for actual plain text / string content. For that: use standard "Edit | Find | Find in Path..." (to search across files) or CTRL + SHIFT + F
CTRL + F
- Find
CTRL + R
- Find and Replace
F3
- Find next/previous
SHIFT + F3
- Find previous
CTRL + SHIFT + F
- Find in path
CTRL + SHIFT + R
- Find and Replace in path
ALT + F7
- Find usages
CTRL + F7
- Find usages in file
CTRL + SHIFT + F7
- Highlight usages in file
CTRL + ALT + F7
- Show usages
LOCAL HISTORY (VCS):
ALT + SHIFT + C
- View recent changes
ALT + BACKQUOTE (`)
- ‘VCS’ quick popup
CTRL + K
- Commit project to VCS
CTRL + T
- Update project from VCS
RUNNING:
SHIFT + F10
- Run
CTRL + SHIFT + F10
- Run context confiuration from editor
CTRL + SHIFT + X
- Run command line
DEBUGGING:
SHIFT + F9
- Debug
F8
- Step over
F7
- Step into
SHIFT + F8
- Step out
ALT + F8
- Evaluate expression
F9
- Resume program
CTRL + F8
- Toggle breakpoint
CTRL + SHIFT + F8
- View breakpoints
LIVE TEMPLATES:
CTRL + J
- Insert Live Template in a project
eco
- ‘echo’ statement + you can fill the echo
fore
- foreach(iterable_expr as $value) {...}
forek
- foreach(iterable_expr as $key => $value) {...}
inc/inco
- ‘include’/‘include_once’ statement
prif
- private function
pubf
- public function
prof
- protected function
rqr/rqro
- ‘require’/‘require_once’ statement
and many more...
OTHER TIPS & TRICKS:
- > LINK < to the official PhpStorm .pdf documantation
- To change the default shortcuts/hotkeys go to: CTRL + ALT + S (Settings) -> Keymap
Code -> Inspect Code
- Check for errors/reduntant files and usage(s)
You can also access the Inspection Results tool window by selecting View | Tool Windows | Inspection Results.
NOTE: It wIll be available ONLY after you run Code | Inspect Code
For each problem, you can see the suggested quick-fix by pressing Alt+Enter. You can also jump to the corresponding line in the editor by pressing F4 or by double-clicking the problem in the tool window.
Editor > General > Smart Keys:
- Surround selection on typing quote or brace. Select a text and by pressing ' it will become 'text': http://stackoverflow.com/questions/31406616/how-to-wrap-selection-in-quotes-using-phpstorm
CTRL + SHIFT + D
- Zeal: https://zealdocs.org/ - offline documentation - integrates nicely with PHP Storm: can install documentation + APIs of many languages like: WordPress, HTML, CSS, jQuery, JavaScript, Emmet, PHP, etc.
Compare any text sources
-
Press Ctrl+Shift+A and start typing to locate the Open Blank Diff Window action.
-
Paste any text you want to compare in the left and right panels.
Bookmarks
If you need to create a bookmark you can easily do it by clicking on the particular code line and choose Set Bookmark (or press F11);
Later on you can press SHIFT + F11 to view the bookmark(s):
How to surround selection with parenthesis / braces / brackets:
Highlight a text and press SHIFT + ( and the selection will be in brackets / braces / parenthesis.
The same goes with:
SHIFT + {
SHIFT + [
I can share the plugins I use!
I believe the info will be useful for the PhpStorm fans 🙂
Here they are:
- CodeGlance: Embeds a code minimap similar to the one found in Sublime into the editor pane.
P.S. To toggle (open/close) the map - you must press CTRL + SHIFT + G
- RegexpTester - Regular Expression Tester for PhpStorm like https://regex101.com/
- Live Edit - Instantly shows changes made to your code during a debugging session.
By default, the Live Edit functionality is enabled for HTML and CSS files only. To turn it on for JavaScript, Node.js, and other file types, go to Settings/Preferences | Build, Execution, Deployment | Debugger | Live Edit.
To start using Live Edit, open the HTML file you’re working with and select Debug in its context menu. This will launch the JavaScript debugger in WebStorm and open your file in the browser. As you edit the code, you’ll see the changes you make reflected in the browser.
To add WordPress to your PHPStorm project you can see the documentation here:
You can also speed up your WordPress development by installing and using WP-CLI on your machine;
Read here how to install WP-CLI on Windows 10:
https://make.wordpress.org/cli/handbook/guides/installing/#installing-on-windows
See video how to do it (Russian language):
... and in English: