PhpStorm has a lot of settings simplifying the developer’s work. But some very convenient settings are turned off by default. On the other hand, some rarely used ones are turned on by default. It could make work with the IDE slower than it could be.
After I’ve just installed PhpStorm, I normally change the following default settings:
These are my personal preferences. But, in my experience, changing these default settings speeds up my work a little bit.
Also, if you are just starting developing in PhpStorm and looking for the best way to set up your development environment locally (the problem I had in the past too): the best way to set up the local development environment for PhpStorm would be probably to deploy the project locally on your computer hard drive and then mount it to the Oracle VirtualBox VM using guest additions. In this way, PhpStorm works fast. And you can use all the advantages of the IDE (unlike if you try to work on any kind of a network share directly).
1. Open search results each time in a new tab
By default: when you search in PhpStorm (⌘ ⇧ F on Mac or Ctrl Shift F on Windows) and click the button Open in New Window in the search window, the results are shown in the same tab every time (overwriting each other). So you can not switch between the current and previous search results quickly. You need to search again instead.
How to change:
- Run the search (⌘ ⇧ F on Mac or Ctrl Shift F on Windows)
- Click the button Open in New Window on the bottom right of the search window
- Right-click on a tab in the search results
- Select
View Options > Open Results in New Tab
Why? It is convenient to switch between recent search results. If you have those search results in different tabs, you could switch between the tabs easily. But if your search results are always in the same tab (overwriting each other), you’ll need to search again to see the previous search results.
Many IDEs show search results in different tabs by default. For example, NetBeans always showed them like that. But PhpStorm shows search results in the same tab by default. Fortunately, this is configurable.
2. Turn off browser icons
By default: PhpStorm shows browser icons in the right upper corner of the editor window.
How to turn it off:
- In
Preferences
on Mac (orFile > Settings...
on Windows) go toTools > Web Browsers and Preview
- Uncheck the checkbox For HTML files in the section Show browser popup in the editor on the bottom of the window
- Click the button Apply
Why? Unfortunately, PhpStorm shows these icons not just for HTML files, but for PHP files as well. In most CMSs (e.g. WordPress) or frameworks (e.g. Yii Framework or Zend Framework), it is useless. You need to run your framework or CMS to see how this PHP template will actually look. But if you click on one of these icons, PhpStorm will open the current file in a browser (instead of running the CMS or framework code to show the corresponding page).
So, in most cases, when you work with any CMS or framework in PHP, those icons just take up space on the screen.
But if you work a lot with static HTML files, those icons would be very useful to you of course.
3. Make all blocks expanded by default
By default: inline styles or block comments are shown collapsed.
How to change:
- In
Preferences
on Mac (orFile > Settings...
on Windows) go toEditor > General > Code Folding
- Uncheck all checkboxes in the panel
- Click the button Apply
Why? It could be convenient to see all inline styles, all block comments, etc. to be open by default. Without any need to click on them to expand.
Please notice: 1) Unchecking only the upper checkbox Show code folding outline would hide only code folding toggles on the left. The code folding would still work:
2) Of course, you can always collapse/expand all code fragments with ⇧ ⌘ – / ⇧ ⌘ + on Mac or Ctrl Shift NumPad – / Ctrl Shift NumPad + on Windows. But I think it could be more convenient to keep all code fragments expanded initially.
It is very convenient to see all blocks visible (=expanded) by default without need to click anything. Of course, this is a matter of taste. Some people could like code folding.
4. Turn on Mark modified (*)
By default: tabs with modified (but not saved yet) files are not marked in any way.
How to change:
- In
Preferences
on Mac (orFile > Settings...
on Windows) go toEditor > General > Editor tabs
- Check the checkbox Mark modified (*)
- Click the button Apply
Why? It is convenient to see if you’ve forgotten to save a modified file. Some IDEs (like NetBeans) have modified files in tabs marked with an asterisk (*) by default.
5. Increase the tab limit
By default: you can have only 10 simultaneously open editor tabs in PhpStorm. If you open the 11th tab, one of your already open tabs will close automatically.
How to change:
- In
Preferences
on Mac (orFile > Settings...
on Windows) go toEditor > General > Editor tabs
- Under the Closing Policy increase the Tab limit to at least 20.
PhpStorm could easily take 4GB of RAM. So, see for yourself how much you can increase this limit. On an iMac with 24GB of RAM, I keep the tab limit on 25. And I often have more than 1 project open at the same time. - Click the button Apply
Why? It could be very inconvenient when PhpStorm automatically closes one of the recent tabs for you. Of course, you could press ⌘ E on Mac or Ctrl E on Windows and reopen one of the recently opened files. But, maybe just keeping the tabs open, and closing them manually when you no longer need them, could be more convenient.
6. Turn off the bulb icon on the left
By default: when you hover the mouse over the beginning of any line in the editor, you often see the bulb icon.
How to turn it off:
- In
Preferences
on Mac (orFile > Settings...
on Windows) go toEditor > General > Appearance
- Uncheck Show intention bulb
- Click the button Apply
Why? You often need to hover your mouse over the left part of the editor screen. For example, to highlight some text in the editor with the mouse. Having the bulb icon there could be inconvenient on such actions.
7. Turn off Code Analysis on Commits to Git
By default: when you commit your changes to Git, the Code Analysis dialog is shown. Sometimes you already know about your code problems and do not want to see this dialog each time on commit.
How to turn it off:
- Press ⌘ K on Mac or Ctrl K on Windows
- Click the Show Commit Options icon at the bottom of the Commit panel (see the image below)
- Uncheck the Analyze Code checkbox (I normally also uncheck the Check TODO checkbox since I do not need the TODO warnings as well)
Why? Sometimes you already know about your code problems. It could be an old project, you could know that those errors are not critical and do not affect security. And you could intend to address those errors in the future. But currently, you do not want to see this reminder on each commit. In this case, you might want to disable the code analysis on commits to Git.
Of course, the final decision is up to you. If you think you need this dialog as a security measure against committing any errors in your code to Git, keep the Code Analysis reminder on.
8. Turn off Saving Context on Commit
A context is a set of tabs, bookmarks and breakpoints open in the editor (source).
By default: a context is saved on every commit to Git.
How to turn it off:
- In
Preferences
on Mac (orFile > Settings...
on Windows) go toTools > Tasks
- Uncheck Save context on commit
- Click the button Apply
Why? When a context is saved automatically on every commit to Git, it could be inconvenient. Because your list of contexts becomes polluted with automatic saves. And pretty useless.
It could be better to save a context manually: Tools > Tasks & Contexts > Save Context...
And then load it manually when necessary:Tools > Tasks & Contexts > Load Context...
Turning off context saving on commit could help to keep your list of contexts clean. Not polluted with automatic saves.
9. Turn off Restoring Context on Switching Git Branches
A context is a set of tabs, bookmarks and breakpoints open in the editor (source).
By default: when switching a git branch in PhpStorm, the context is changed to the last used in this branch. This is convenient situationally. Sometimes it could be convenient. But on most projects, I prefer to keep this option off and save/load contexts manually when necessary.
How to turn it off:
- In
Preferences
on Mac (orFile > Settings...
on Windows) go toVersion Control > Confirmation
- Uncheck Restore workspace when switching branches
- Click the button Apply
Why? E.g. you’ve just pushed changes to production. And you suddenly find a bug you need to fix urgently. So you do not have time to switch between branches. You could just do small corrections quickly right in the branch master. It would be convenient if necessary tabs were already open in the branch master.
Of course, when you complete working on changes in a branch, you need to save the context manually. So that you could return to this context later if you need to work on similar changes.
10. Turn on Selecting the Current File in the Project Panel on Changing a Tab
By default: when you change a tab, the corresponding file is not selected in the Project panel on the left. It could be convenient if the active (in the tab) file was selected automatically in the Project panel.
How to turn it on:
- In the Project panel click the Show Options Menu icon on the right top
- Check Always Select Opened File
Why? It could be convenient when an active file in the Project panel gets selected on tab change. Because often you need to open files in the same subfolder nearby. So, it simplifies navigation inside the project.
Or you could keep this feature off. And select the active (in the current tab) file in the Project panel by pressing ⌥ F1 and then 1 on Mac or Alt F1 and then 1 on Windows (source).
11. Turn off Reopening Projects on Startup
PhpStorm shows the list of projects on startup by default. But on one of the IDE updates, it somehow stopped showing the list of projects on startup for me once. So I decided to include the fix here.
Problem: When you start PhpStorm and it does not show a list of projects to choose from (but opens the most recently opened project instead), it could be inconvenient.
How to fix:
- In
File > Settings...
on Windows, go toAppearance & Behavior > System Settings
- Uncheck Reopen projects on startup
When the option Reopen projects on startup is checked, on startup, PhpStorm will automatically reopen your most recently opened project. - Click the button Apply
(source)
Now, on startup, you’ll see the window:
And you’ll be able to choose the project to work with.
Why? If you have multiple projects and the wrong project gets opened on startup automatically, you’ll need to close it and open another project. It could take time. And could be inconvenient.
12. Solving Performance Problems
If you edit a large file with mixed PHP, JavaScript, and CSS code and experience constant lags and 100% CPU load, it can be very annoying.
In this case, you can turn off code inspections for this particular file:
- Hover the mouse over the inspections block in the upper right corner of the editor (see the image below)
- Click on
"PHP: All Problems"
- Select
"None"
(or"Syntax"
).
Do the same for "HTML: All Problems"
.
Please notice: If you set PHP (or HTML) inspections to "None"
, PhpStorm will stop highlighting any PHP (or HTML) syntax errors. So, unless the performance problem is really bad, it is better to use the option "Syntax"
rather than "None"
Why? For me, such lags happened on large files only. Lags and 100% CPU load are annoying. When it happens, I turn off code inspections for this particular file, at least temporarily.
Another way to avoid lags would be switching to VS Code. If you do not install resource-consuming plugins, VS Code will be a very lightweight and efficient IDE. Though, in my opinion, it is slightly less convenient than PhpStorm.
Conclusion
Of course, these are my personal preferences. They make my own work with PhpStorm faster.
If you use any other settings to simplify your work in PhpStorm, I would be very grateful if you told me about them in the comments below.
Great tip on the search result!
Thank you very much for the good words!
Hi, I do the git commit unchecks as well but some others totally different what is quite interesting.
1. the very first I do is I disable! Tabs bc of the powerful Search everywhere (Double Shift) feature in JetBrains IDEs. I want to avoid the mess with them and reduce the usage of the mouse. And tbh 10 tabs open is already quite messy 😉
2. then I search for the option named “search.everywhere.disable.history.for.all” in the registry in case the last search is displayed in a new search to avoid that bc in most cases I want to have just listed the previous files
3. install .ideavim plugin (incl. resolving shortcut conflicts)
4. Keymap settings:
choose the right keymap (my choice is IntelliJ Classic (OS X))
assign Show Context Menu (Mouse right-click), Restore Current Layout, Annotate (git blame) … to your like
(the keyboard shortcuts pdf in Help menu is a good advisor in general)
5. Help menu > Change Memory Settings (it is 1024MB by default if I remember correctly) and increase this by factor 2,3 or 4 depends on the machine
I am on a Mac and afair I did not need to uncheck opening the last project, I think it was off by default.
That’s it more or less, beside installing further plugins, choosing/tweaking the right color scheme and creating some useful Live Templates
Thanks for your comment! Yes, we do many things differently. 🙂
No, I never modify the registry. I did not find inconvenient to have the previous search string in Search Everywhere on double shift. For viewing the list of recently opened files, I use Ctrl+E…
The only thing, yes, I also always increased the maximum heap size (as you said, in Help menu > Change Memory Settings or in JetBrains ToolBox in PhpStorm Settings > Configuration). Currently, it is set to 3500 MB on my laptop (which has 16 GB of RAM). On computers with more RAM, I set it to a little bit bigger values. I forgot to mention this in the article.