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?
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?
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.
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.
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.
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
IntelliJ 2023.1
To do this by default, right-click "Project" and select "Always Select Opened File". You might need to re-enable this when you open new projects.
If you have NOT enabled "Always Select Opened File" as discussed previously, then you can click "Select Opened File" to do it for the current file. You will not see the "Select Opened File" icon if you have enabled "Always Select Opened File" for the project.
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.