Search code examples
javaintellij-ideashortcut

Intellij shortcut - how to open at project view current class?


I just want to know if it is possible at Intellij open Project view for class which is currently opened. Using short cut.

Steps:

  • After using find class shortcut (Ctrl+N) => type String
  • Press String class from JDK. It has next looking:

enter image description here

  • And now when press Alt+1 => It will open Project view where it was active last time.
  • But I want to know how to open this view and cursor is exactly at this class location:

enter image description here

I tried to find it at internet but without success.

Any suggestions?


Solution

  • You can click the settings icon in the project view and check Autoscroll from source. That way any class (or any file for that matter) you open will be automatically selected in the project view.

    enter image description here

    or if you don't want this to happen always you can click this icon to naviage to the currently opened item in the project view:

    enter image description here

    Unfortunately I don't see any command in keymap section to bind this action to a keyboard shortcut.