PhpStorm: Tips and tricks. Part 1
Today we will talk about some of the features of the wonderful PhpStorm IDE. The Jetbrains programmers put a lot of effort into creating their product, as a result we have a powerful and one of the best IDEs for the php programming language. I think the times when I wanted to stand out with programming in Notepad ++ are almost gone. It’s extremely difficult to develop modern large projects with many files on the knee without a good tool.
So, let's go:
All hotkeys are valid for Windows and I think the Linux version, Macosniki can find keyboard shortcuts in the corresponding section of the IDE settings
So, let's go:
- Search Everywhere . Double-pressing the Shift key brings up a popup window to search for anything and anywhere. It is enough to write a fragment of the desired text, and our hard worker bee will find occurrences, and group them into categories. Snippets found in classes, files, characters, and even menu items. Fast and convenient, isn't it?Search Everywhere in Action
- Search in the window . Being in the window with the list of project files (Project), we just start writing the name of the file or folder that we want to find. Found files and folders are very clearly highlighted in the list. The up and down keys navigate through the search results.Search in window in action
- Exit IDE settings by pressing Esc . Being in the settings, we can quickly close the window by pressing the Esc key, that is, we do not have to touch the mouse, let it rest.
- Code Inspection Navigation . To the right of our code, we see the result of a background inspection of the code. The IDE tells us about errors and inaccuracies in the file. You can navigate between these errors and comments by pressing F2Code Inspection Navigation in Action
- Recent open files . Ctrl + E opens a popup window with files that we recently opened. Also in this window you can start writing the name of the file that interests us, and the IDE will filter the list.Recent open files in action
- Fast phpDoc comment generation . We type / ** press Enter and the comment construction will end automatically. If parameters and types are specified in a method or function, the IDE will take this information into account when generating. And if there is a keyword return, then even try to guess the type of return valueFast phpDoc comment generation in action
- Code generator . Click in the Alt + Insert file. In the popup window that appears, the IDE offers us to override the method, implement the method, add a constructor, getters and setters, as well as phpDoc commentsCode generator in action
- Refactor This . Ctrl + Shift + Alt + T In the window that opens, we are given a wide selection of code refactoring. Before applying the changes, you can select a preview to evaluate which files will be changedRefactor This in action
- Postfix Completion . A handy tool that appeared in version 9 of the IDE. Allows you to quickly write constructions like if, if not, etc.
Before inserting the auto-add, we draw a point and the IDE opens a popup window with a choice to complete the insert.Postfix Completion in action
- Productivity Guide . This section will show your statistics on the use of various “Features.” All data is presented in a table with columns: Feature - name, Group - category, Used - how much time you used it, Last used - when you last used it. The statistics plate can be sorted by each column. This section is also noteworthy for the description of various features, which indicate the hot keys for calling.Productivity Guide in action