Using Favorites in IntelliJ IDEA to Quickly Access Files
Working with code in IntelliJ IDEA is a real joy. To quickly access files we change often we can add those files to Favorites tool window. Once a file is placed in Favorites we can use the shortcut key Cmd + 2 (Alt + 2 for Windows/Linux) to open the tool window and select a file.
To add a file in the Favorites tool window we have several options. We can right-click on the tab of the open file. IntelliJ IDEA shows a popup menu and we can select the option Add to Favorites. Then we can choose to add the file to an existing favorite list or create a new one. The default list has the same name as the project. In the following screenshot we see the name of the project is spring-config, so the default favorite list is also called spring-config:
We select the default list to add our file. If we open the Favorites tool window we can see the file is now added to the favorite list:
We can also use a shortcut key combination Option + Shift + F (Alt + Shift + F for Windows/Linux) if we have a file open. We see a dialog window where we can choose if we want to place the file in an existing favorite list, which by default is the name of the project, or we can choose to create a new list to store files:
Let's create a new favorite list and select the option Add to New Favorites List. IntelliJ IDEA show a new dialog window where we can fill in the name of our list:
If we now look at our Favorites tool window we can see the new list and we have a file in the default spring-config list and in the Configuration Files list:
Finally we can also use the mouse to move a file from the Project tool window to a favorite list. We can move the file to any favorite list and it will be part of that list:
IntelliJ IDEA 12.0.4 is used for this blog post.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)