How to automatically navigate to the current class

2019-01-30 09:08发布

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?

6条回答
Melony?
2楼-- · 2019-01-30 09:47

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.

查看更多
爷、活的狠高调
3楼-- · 2019-01-30 10:05

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

查看更多
Viruses.
4楼-- · 2019-01-30 10:08

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.

查看更多
我只想做你的唯一
5楼-- · 2019-01-30 10:10

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.

查看更多
虎瘦雄心在
6楼-- · 2019-01-30 10:12

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

查看更多
爷的心禁止访问
7楼-- · 2019-01-30 10:14

Try Alt F1(Select Target dialogue) + Enter.

查看更多
登录 后发表回答