How to automatically navigate to current class in IntelliJ IDEA Project Tool Window?

Intellij Idea

Intellij Idea Problem Overview


I would like to have a keyboard shortcut in IntelliJ IDEA that has the following effect: the tree in the project tool window expands to show the currently open class (or file), and this class becomes selected in the tree.

Is this possible?

Intellij Idea Solutions


Solution 1 - Intellij Idea

Navigate (View in older versions)| Select In... (Alt+F1), Project View (Enter).

It's also possible to enable Autoscroll from Source option in the Project View so that current file is automatically selected.

Solution 2 - Intellij Idea

IntelliJ IDEA 2019

Left click on the wheel > Always Select Opened File

Always Select Opened File

There is also: Open Files with Single Click - the selected file from the tree view will be opened in the right side.


Old IntelliJ versions

Right click on Project/Packages area > Autoscroll from Source

enter image description here

or

Left click on the wheel > Autoscroll from Source

enter image description here

There is also: Autoscroll to Source - the selected file from the tree view will be opened in the right side.

Solution 3 - Intellij Idea

Try Alt F1(Select Target dialogue) + Enter.

Solution 4 - Intellij Idea

Click at this icon click on this icon on the top of tree-box.

Solution 5 - Intellij Idea

you can do this also using the upper dynamic menu that change for every opened file. just click twice on the last folder and the file will be on the same folder branch

enter image description here

also good for pycharm

Solution 6 - Intellij Idea

You can also make your own key combo to the "select in tree view" via prefs. I often do: shift + cmd + a and then just write select in.. and then press enter.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionlbalazscsView Question on Stackoverflow
Solution 1 - Intellij IdeaCrazyCoderView Answer on Stackoverflow
Solution 2 - Intellij IdeaROMANIA_engineerView Answer on Stackoverflow
Solution 3 - Intellij IdeaVicView Answer on Stackoverflow
Solution 4 - Intellij IdeadellasaviaView Answer on Stackoverflow
Solution 5 - Intellij IdeadsaydonView Answer on Stackoverflow
Solution 6 - Intellij IdeaSentry.coView Answer on Stackoverflow