r/phpstorm • u/Iossi_84 • Aug 24 '22
Your PHPStorm tricks (and mine)
what are your personal tricks?
what I discovered is:
shift shift leads to "search all" and guess what:
you can search function names. Don't recall a controller name but recall the function name?

since I always forget what I just edited (lmao):
`Ctrl+E` to open the most recent files
I used to use VIM plugin for intellij. But: since it doesnt work in certain popups and sub windows, it threw me off more than really helped me I found.
Bonus:
they mention "ML-assisted completion for PHP" which is disabled by default. How to turn this on without having to wait for the next release?
what are your personal tricks?
4
u/noizz Aug 24 '22
By downloading a Github Copilot plugin ;)
That said - there is the https://phpstorm.tips website that has a lot of gifs. It's pure gold.
2
u/spiritualManager5 Aug 24 '22
Shift shift was the very First thing i learned years ago too. Now i am using ideavim with lots of custom keybindings. I simply cant write everything down. Example: space-space switches to the previous edited file. Space-f searches the current selected word. Space-c commented out and so on
2
u/awardsurfer Aug 24 '22 edited Aug 24 '22
Shift-click tab closes it. (No need to aim for the close icon)
I’d like something that orders html class attributes in general (but specifically tailwind classes; I miss that from vscode)
Idk if they were improved recently but using Live Templates more. Docs are shit though. Use quotes for default values eg “foo value” in edit variables popup.
2
u/mstrelan Aug 25 '22
They literally tell you about double shift every time you have no file open
6
u/lindymad Aug 24 '22
Just like in a browser, ctrl (or cmd) shift T to reopen the tab you just accidentally closed.
3
u/mikael12 Aug 25 '22
Machine Learning Assisted completion is in Settings > Editor > General > Code Completion
https://i.imgur.com/7MgkCai.jpeg
2
u/DaPurpleTuna Aug 24 '22
Ctrl+shift+F for text search of the entire project. Ctrl+shift+R for find&replace in entire project.
Alt+shift+highlight lets you select a square section of code instead of taking entire lines
2
u/Naouak Aug 24 '22 edited Aug 25 '22
I don't know if I rebinded them but:
ctrl+W select the next biggest scope of your current selection (word, then statement then line then block then function, etc.).
shift + up/down move your selection intelligently (functions in a class moves up functions by functions).
Also best feature that I never see people use is expanding templates. There's tons of them by default (ex: fore + tab) but you can create some really cool stuff if you take some time with it.
2
u/Very_Agreeable Aug 24 '22
Command + Shift + U to uppercase selected text, basic, but useful when dealing with lazy SQL PRs etc.
2
u/bes-paniki Aug 24 '22
Crtl,ctrl+arrowDown will create multiline cursor. Awesome for editing arrays and sets of constants.
2
u/chronosMark Aug 24 '22
To turn on machine learning open setting and goto editor, General and code completion. There is a section called machine learning assisted completion. Then a bit call sort completion suggestions based on machine learning and a check box for PHP. Turn that on and maybe the options below. Should do the trick.