How to automatically navigate to current class in IntelliJ IDEA Project Tool Window?
Intellij IdeaIntellij 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
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
or
Left click on the wheel > Autoscroll from Source
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
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
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.