Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to quickly jump to the class declaration line in IntelliJ?

Suppose a Foo.java file which defines the Foo class.

The cursor is now on some line of Foo.java. The symbol under the cursor is not necessarily Foo).

How to quickly jump to the class declaration line (i.e., the line like public class Foo {) in Intellij?

Any shortcuts for this?


I use the ideavim plugin. Therefore, solutions relying on vim functionalities are OK.

like image 894
hengxin Avatar asked Aug 25 '16 02:08

hengxin


1 Answers

On Mac you can do cmd + up arrow (on Windows or Linux, I'm assuming it will be ctrl + up arrow)

This will select the current file in the breadcrumb (navigation bar) then hit enter and you'll be at the class declaration

You can look to which key combination this is mapped for you by looking in the keymaps for 'Jump to Navigation Bar'

Jump to Navigation Bar

like image 142
Frederic Close Avatar answered Nov 02 '22 19:11

Frederic Close