399

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

3

17 Answers 17

822

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

12
  • 69
    Cmnd f12 on mac. I think this is a better answer. Commented Aug 9, 2012 at 13:41
  • 10
    Cmnd + ALT + O is also very useful on macs, to find symbols.
    – Felipe
    Commented Jul 26, 2013 at 20:06
  • 3
    What's the name of action to show all members of the current class?
    – sealskej
    Commented May 22, 2014 at 10:18
  • 1
    In fact in Eclipse this is Ctrl+O (Quick Outline). Ctrl+Shift+O is for Organize imports. Commented Aug 8, 2014 at 10:04
  • 13
    @sealskej it's called "File Structure" on the keymap setting.
    – shanwu
    Commented Nov 20, 2016 at 12:50
360

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.

10
  • 147
    If you type "sudo grep something /" you can also find anything, on your whole computer :)
    – olafure
    Commented Mar 2, 2015 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. Commented Mar 3, 2015 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. Commented Mar 18, 2015 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
    Commented Dec 30, 2015 at 17:53
  • 1
    what is difference between this and Ctrl+Alt+Shift+N ?
    – Mahesha999
    Commented Aug 30, 2016 at 14:22
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.)

4
  • Thank you very much! And how can I find this option on menus?
    – Felipe
    Commented Sep 20, 2010 at 18:38
  • I found it! It is under Go To menu. Easy!
    – Felipe
    Commented Sep 20, 2010 at 18:55
  • 2
    Does not work for me on mac. Although CMD+ F12 works. Thanks
    – Ajak6
    Commented Aug 29, 2016 at 19:59
  • Ctrl + F12 worked nice for me. Intelli IDEA J 2018.2
    – minhas23
    Commented Oct 31, 2018 at 8:41
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.

4
  • 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
    Commented Jan 14, 2016 at 19:24
  • 1
    For complete clarity, what exactly is the definition of "Symbol" in terms of Android Studio?
    – Lv99Zubat
    Commented May 16, 2017 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. Commented May 17, 2017 at 0:12
  • For those wondering, this action is called "File Structure" in Actions search menu.
    – ssppjj
    Commented May 10, 2023 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

1
  • 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
    Commented Dec 20, 2018 at 10:09
12

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

7

IntelliJ IDEA Version 12.13 Ultimate Edition:

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

2
  • 2
    Did not work for me this option. Here in Mac is command + option + O
    – Felipe
    Commented Jun 4, 2013 at 19:53
  • 1
    It depends on the keymap you choose in "Preference->Keymap" . it seems you choose the "Mac OS X 10.5+"
    – user674158
    Commented Apr 13, 2014 at 9:43
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)

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)

1
  • I've removed the tutorial URL. Please don't include the URLs that could be considered as spam.
    – Tushar
    Commented Apr 24, 2016 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

0
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.

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.

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.

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

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.

0
0

Ctrl + F12 and type method name. once you type method name, input text box will appear for same.

In IntelliJ IDEA 2022.1.2 or greater version

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.