Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Locate current file in IntelliJ

How do I locate the current file in the project structure? (Similar to Visual Studio's Ctrl + Alt + L). What is the name of the operation (so I can define it in the keymap)

like image 242
ripper234 Avatar asked Jul 06 '09 08:07

ripper234


People also ask

How can I see all files in IntelliJ?

By default, IntelliJ IDEA shows all classes, methods, and other elements of the current file. To toggle the elements you want to show, click the corresponding buttons on the Structure tool window toolbar. to show class fields. to have protected class members shown in the tree.

How do I navigate files in IntelliJ?

Press Ctrl+Shift+T or choose Navigate | Go to File... from the main menu . Alternatively, you can press Ctrl+Shift+A , start typing the command name in the popup, and then choose it there.


2 Answers

Alt + F1 (or Alt + Shift + 1 for linux) almost does what you want. You need to hit Enter afterwards as IDEA allows multiple "targets" for navigation (project structure, file structure etc).

(Note you can also set AutoScroll to Source and AutoScroll from source using the two "boxes with arrows" buttons above the project structure view but this can get annoying when it shoves you into the JDK source because you followed a reference to java.io.File.

The keymap defines it as Select current file or symbol in any view.

like image 93
butterchicken Avatar answered Sep 18 '22 04:09

butterchicken


You can also click the little cross hairs button in the projects pane:

enter image description here

Note that the symbol won't be shown if Always Select Opened File (previously Autoscroll from Source) option is enabled.

like image 45
Timo Reimann Avatar answered Sep 20 '22 04:09

Timo Reimann