10 Settings to Simplify Work In PhpStorm in 2021

PhpStorm has a lot of great 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), a small tip for you: 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:

  1. Run the search (  F on Mac or Ctrl Shift F on Windows)
  2. Click the button Open in New Window on the bottom right of the search window
  3. Right-click on a tab in the search results
  4. Select View Options > Open Results in New Tab
Open Search Results in a New Tab
Open Search Results in a 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. E.g. 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.

Browser Icons in PhpStorm
Browser Icons in PhpStorm

How to turn off:

  1. In Preferences go to Tools > Web Browsers
  2. Uncheck the checkbox For HTML files in the section Show browser popup in the editor on the bottom of the window
  3. Click the button Apply
Turn off Browser Icons in PhpStorm
Turn off Browser Icons in PhpStorm

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 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.

Collapsed vs Expanded Blocks in PhpStorm
Collapsed vs Expanded Blocks in PhpStorm

How to change:

  1. In Preferences go to Editor > General > Code Folding
  2. Uncheck all checkboxes in the panel
  3. Click the button Apply
Make All Blocks Expanded by Default in PhpStorm
Make All Blocks Expanded by Default in PhpStorm

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:

Hide Code Folding Toggles in PhpStorm
Hide Code Folding Toggles in PhpStorm

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:

  1. In Preferences go to Editor > General > Editor tabs
  2. Check the checkbox Mark modified (*)
  3. Click the button Apply
Turn on Mark modified (*)
Turn on Mark modified (*)

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:

  1. In Preferences go to Editor > General > Editor tabs
  2. 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.
  3. Click the button Apply
Tab Limit in PhpStorm
Set Tab Limit in PhpStorm

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.

Bulb Icon in PhpStorm
Bulb Icon in PhpStorm

How to turn off:

  1. In Preferences go to Editor > General > Appearance
  2. Uncheck Show intention bulb
  3. Click the button Apply
Turn off the Bulb Icon in PhpStorm
Turn off the Bulb Icon in PhpStorm

Why? You often need to hover your mouse over the left part of the editor screen. E.g. to highlight the text in the editor with the mouse. Having the bulb icon there on such actions could be inconvenient.

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 off:

  1. Press  K on Mac or Ctrl K on Windows
  2. Click the Show Commit Options icon at the bottom of the Commit panel (see the image below)
  3. Uncheck the Analyze Code checkbox (I normally also uncheck the Check TODO checkbox since I do not need the TODO warnings as well)
Turn off Code Analysis on Commits
Turn off Code Analysis on Commits

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 off:

  1. In Preferences go to Tools > Tasks
  2. Uncheck Save context on commit
  3. Click the button Apply
Turn off Saving Context on Commit
Turn off Saving Context on Commit

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...

Save and Load Context in PhpStorm
Save and Load Context in PhpStorm

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 off:

  1. In Preferences go to Version Control > Confirmation
  2. Uncheck Restore workspace on branch switching
  3. Click the button Apply
Turn off Restoring Context on Branch Switching
Turn off Restoring Context on Branch Switching

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 on:

  1. In the Project panel click the Show Options Menu icon PhpStorm Show Options Menu Button on the right top
  2. Check Always Select Opened File
Select Opened File in the Project Panel
Select Opened File in the Project Panel

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).

Conclusion

Of course, these are my personal preferences. They make my own work with PhpStorm faster.

If you use any other settings, simplifying your work in PhpStorm, I would be very grateful if you told me about them in the comments below.

Leave a Reply

Your email address will not be published. Required fields are marked *