how to add a file to favorites?

On the left side of the PhpStorm UI there is something called Favorites. How to add a file to it that does not belong to current project?  e.g. I am working on a project, but I need to open other files often, that evidently do not belong to the project. Is it possible at all? Here is what I tried:

  • File->Open Directory and I chose the directory containing my favorite file
  • Open the directory in the Project window
  • Right-click the file and add it to new favorites list named "test"
  • File-> Open my regular project directory
  • The "test" favourite list is gone. Adding new "test" favourite list adds a new one, not that which I created above.

So, is it possible to add files from outside of the project to Favorites?

If yes, then maybe also another question: is it possible to copy favourite lists between projects? Because I have some really favorites, like e.g. httpd-vhosts.conf from apache directory and I need those files to be accessible in every project and it seems unproductive to add them again and again to every new project.

Comment actions Permalink

Hi there,

Favorites are per project.

To add non-project file to favorites -- just open that file in PhpStorm (e.g. drag & drop from Explorer or whatever you have there) and add to favorites.

You can even add whole folder to favorites.

  • If you want to add such non-project folder, then you will have to edit the .idea/workspace.xml file manually (while that project is closed in PhpStorm) -- search for <component name="FavoritesManager"> section.
  • Another approach (which may be enough, but that depends on your requirements) is to add such external folder as Additional Content Root (Settings | Directories) or as External Library (Settings | PHP)

is it possible to copy favourite lists between projects?

No (at least I do not know such way). Even worse (from your requirements point of view) -- favorites are part of workspace.xml, which is individual per developer/project (which means -- you can safely put all other files from .idea folder under version control except that file). Therefore you cannot easily copy favorites between projects.

Comment actions Permalink

Thanks a lot, I managed to kind of share my favorites between projects by copying the component section you mentioned in the workspace.xml files.


Please sign in to leave a comment.