386

I know that Ctrl + N is to find classes and it is very useful. But what about methods?

Felipe
  • 16,649
  • 11
  • 68
  • 92
  • 3
    possible duplicate of [What is Eclipse's Ctrl+O shortcut equivalent in IntelliJ IDEA?](http://stackoverflow.com/questions/1945213/what-is-eclipses-ctrlo-shortcut-equivalent-in-intellij-idea) – Sachin Jain Dec 03 '14 at 06:07
  • It is similar, but it is not exactly the same function. (?) – Felipe Dec 03 '14 at 18:29
  • 2
    For me it is Alt-Cmd-O, Select Navigate->Symbol menu item. Next to it you can see your shortcut. – n0rm1e May 31 '16 at 07:23

17 Answers17

801

ctrl + F12 (cmd + F12 on macOS) will show all members of the current class in a popup window and let you pick up one. It works exactly like the ctrl + o shortcut in eclipse, much faster than ctrl + alt + shift + n

Matthias M
  • 12,906
  • 17
  • 87
  • 116
Daniel Deng
  • 8,011
  • 2
  • 14
  • 2
356

Windows : ^ ctrl + F12

MacOS : ⌘ cmd + F12

Above commands will show the functions/methods in the current class.

Press ⇧ SHIFT TWO times if you want to search both class and method in the whole project.

Paul Verest
  • 60,022
  • 51
  • 208
  • 332
Vikas Gupta
  • 10,779
  • 4
  • 35
  • 42
  • 147
    If you type "sudo grep something /" you can also find anything, on your whole computer :) – olafure Mar 02 '15 at 16:55
  • 13
    @olafure ,yes you can. "sudo grep something /" will search in whole computer and give lot of unnecessary results also will take lot of extra time. So, it's better to search something in IDE only. – Vikas Gupta Mar 03 '15 at 17:35
  • 44
    I believe that's his point... When looking for methods using the option that will even find text results in files outside of the project is a bit heavy-handed. – Josh Gagnon Mar 18 '15 at 15:14
  • 11
    While this answer is technically correct, it's what I've been trying to avoid since I don't want to search multiple files which might have the same method name. the Ctrl+F12 method below with like 3x as many upvotes is what should be marked as the correct answer... – dudewad Dec 30 '15 at 17:53
  • Does not work on Intellij 15.x version for methods (brings lot of clutter but methods) - also it makes sense to use a direct method navigation search for code that is familiar. You can directly jump to a known method name. I think the answer below is better choice. – software.wikipedia Feb 23 '16 at 03:50
  • 1
    what is difference between this and Ctrl+Alt+Shift+N ? – Mahesha999 Aug 30 '16 at 14:22
  • 1
    while this is correct, double shift is terrible at finding method names. It also finds classes and filenames and probably coins under your seat as well. – Alexander Oh Jun 20 '17 at 14:20
  • Also press it FOUR times to include non-project related items. – Johnny Baloney Apr 20 '18 at 11:06
  • Double shift is very useful, but is not what was asked. The answer of Daniel Deng is the correct one – Moxor Jan 29 '19 at 13:55
  • For the sake of completeness, in KDE it's CTRL + 0. – Gustavo Passini Jul 30 '21 at 14:35
106

Ctrl + Alt + Shift + N allows you to search for symbols, including methods.

The primary advantage of this more complicated keybinding is that is searches in all files, not just the current file as Ctrl + F12 does.

(And as always, for Mac you substitute Cmd for Ctrl for these keybindings.)

gvlasov
  • 18,638
  • 21
  • 74
  • 110
Brian Agnew
  • 268,207
  • 37
  • 334
  • 440
17

Android Studio on Mac

Command + Option + O

Opens up the Symbol lookup that you can jump to most of the methods/functions in your currently opened document.

Joshua Pinter
  • 45,245
  • 23
  • 243
  • 245
  • The results displayed using this key combination aren't restricted to the currently open document. For that, cmnd+f12 is what you want (per the answer by Daniel Dang and comment by Thomas). – hBrent Jan 14 '16 at 19:24
  • 1
    For complete clarity, what exactly is the definition of "Symbol" in terms of Android Studio? – Lv99Zubat May 16 '17 at 19:38
  • @ImpalaTamer Good question. I use it to jump to methods, functions and definitions mostly but it looks like it could bring up more than that. – Joshua Pinter May 17 '17 at 00:12
  • For those wondering, this action is called "File Structure" in Actions search menu. – ssppjj May 10 '23 at 14:09
16

Intellij IDEA 2017.3.4 - 2018.2 (Ultimate) on OSX

CMD + fn + F12

will show all members of the current class in a popup window, then you can search method in that class.

BUT, this answer is depends on your Keyboard setting. If your keyboard setting in

System Preferences > Keyboard > Use all F1, F2, etc. keys as standard function keys

is selected, then the shortcut becomes

CMD + F12

nmfzone
  • 2,755
  • 1
  • 19
  • 32
  • I think this should be the correct reply as it gets you to the methods window only, where with further shortcuts we can also see inherited, anonymous and lambdas. Powerful and cool! Thanks – Imam Bux Dec 20 '18 at 10:09
12

CTRL + F12 brings up the File Structure navigation menu, which lets you search for members of the currently open file.

csvan
  • 8,782
  • 12
  • 48
  • 91
7

IntelliJ IDEA Version 12.13 Ultimate Edition:

Macs: command + option + shift + N or on Menu -> Navigate > Symbol ...

Jack Chi
  • 440
  • 4
  • 13
7

Slightly beside the actual question, but nonetheless useful: The Help menu of Intellij has an option 'Default Keymap reference', which opens a PDF with the complete mapping. (Ctrl+F12 is mentioned there)

Geert
  • 3,527
  • 1
  • 20
  • 16
6

If you just want to look for methods:

On mac OS X 10.5+ binding, it is Alt + + O

By Default XWin Key binding, it is Shift + Ctrl + Alt + N

You can also press double SHIFT then, you can search anything (not only method, but also class, files, and actions)

Tushar
  • 85,780
  • 21
  • 159
  • 179
Alex Richard
  • 129
  • 2
  • 1
  • I've removed the tutorial URL. Please don't include the URLs that could be considered as spam. – Tushar Apr 24 '16 at 15:26
5

It is worth adding that if you want to search for a method of a class, you can use a . (dot) between the class and method name inside of either the search everywhere or search symbols dialog. This even works with IDEAs usual search benefits. For example, you can search for LDT.now and LocalDateTime::now will pop up as a result. (As long as you are searching All Files and not just Project Files).

enter image description here

Marv
  • 3,517
  • 2
  • 22
  • 47
3

If you click on a method, you can do Ctrl + B to go to that method's declaration. Similar to F12 in MS Visual Studio.

Misha Akopov
  • 12,241
  • 27
  • 68
  • 82
user4617883
  • 1,277
  • 1
  • 11
  • 21
2

If I need navigate to method in currently opened class, I use this combination: ALT+7 (CMD+7 on Mac) to open structure view, and press two times (first time open, second time focus on view), type name of methods, select on of needed.

flow2k
  • 3,999
  • 40
  • 55
Kein
  • 977
  • 2
  • 12
  • 32
2

To Find the actions build in the IDEA(reindent, create new, ...) you can use

CRTL+SHIFT+A

then type indent for example and ENTER.

Mwiza
  • 7,780
  • 3
  • 46
  • 42
T04435
  • 12,507
  • 5
  • 54
  • 54
0

Intellij v 13.1.4, OSX

The Open Symbol keyboard shortcut is command+shift+s

0

Ctrl + Shift + Alt+ 7 after selecting the method

Mwiza
  • 7,780
  • 3
  • 46
  • 42
Jahongir Rahmonov
  • 13,083
  • 10
  • 47
  • 91
0

I tried SHIFT + SHIFT and ALT + CMD + O

But I think the most powerful and easy to use feature is find in all files CMD + SHIFT + F.

Choose regex and write .*partOfMethodName.*\( and it shows all places and can see the actual source code in place without going to that specific file.

Muhammad Hewedy
  • 29,102
  • 44
  • 127
  • 219
0

Ctrl + F12 and type method name.

In IntelliJ IDEA 2022.1.2 or greater version

SarangRN
  • 91
  • 13