What is the shortcut in IntelliJ IDEA to find method / functions?

206,076

Solution 1

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.

Solution 2

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

Solution 3

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

Solution 4

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.

Solution 5

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

Share:
206,076
Felipe
Author by

Felipe

Java, Android, Scheme, Javascript etc.

Updated on July 31, 2021

Comments

  • Felipe
    Felipe almost 3 years

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

  • Felipe
    Felipe over 13 years
    Thank you very much! And how can I find this option on menus?
  • Felipe
    Felipe over 13 years
    I found it! It is under Go To menu. Easy!
  • Felipe
    Felipe almost 12 years
    now I use mac. Do you know the equivalent shortcut for mac? Thanks!
  • TJ Seabrooks
    TJ Seabrooks almost 12 years
    Cmnd f12 on mac. I think this is a better answer.
  • Felipe
    Felipe almost 11 years
    Did not work for me this option. Here in Mac is command + option + O
  • Felipe
    Felipe almost 11 years
    Cmnd + ALT + O is also very useful on macs, to find symbols.
  • Siddhartha
    Siddhartha over 10 years
    hmmm. Cmd+Alt+O actually leads me to optimize imports. Cmd+alt+shift+n does it though..maybe it depends on the version, I'm on 12.1.4
  • Felipe
    Felipe over 10 years
    @Siddhartha, you need to change your config to fit Mac-style shortcuts. But everything changes.
  • user674158
    user674158 about 10 years
    It depends on the keymap you choose in "Preference->Keymap" . it seems you choose the "Mac OS X 10.5+"
  • sealskej
    sealskej almost 10 years
    What's the name of action to show all members of the current class?
  • Guillaume Husta
    Guillaume Husta almost 10 years
    In fact in Eclipse this is Ctrl+O (Quick Outline). Ctrl+Shift+O is for Organize imports.
  • olafure
    olafure about 9 years
    If you type "sudo grep something /" you can also find anything, on your whole computer :)
  • Vikas Gupta
    Vikas Gupta about 9 years
    @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.
  • Xabs
    Xabs about 9 years
    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.
  • blackbird014
    blackbird014 over 8 years
    This is what I was looking for
  • dudewad
    dudewad over 8 years
    This is awesome because I was only finding answers for searching across the whole project, which is a waste of time when you're searching for a method like "init" or "destroy". Thank you!!
  • dudewad
    dudewad over 8 years
    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...
  • hBrent
    hBrent over 8 years
    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).
  • software.wikipedia
    software.wikipedia about 8 years
    Works on Intellij 15.x version for me. This should be the right answer.
  • software.wikipedia
    software.wikipedia about 8 years
    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.
  • Tushar
    Tushar about 8 years
    I've removed the tutorial URL. Please don't include the URLs that could be considered as spam.
  • Ajak6
    Ajak6 over 7 years
    Does not work for me on mac. Although CMD+ F12 works. Thanks
  • Mahesha999
    Mahesha999 over 7 years
    what is difference between this and Ctrl+Alt+Shift+N ?
  • shanwu
    shanwu over 7 years
    @sealskej it's called "File Structure" on the keymap setting.
  • Lv99Zubat
    Lv99Zubat about 7 years
    For complete clarity, what exactly is the definition of "Symbol" in terms of Android Studio?
  • Joshua Pinter
    Joshua Pinter about 7 years
    @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.
  • Alexander Oh
    Alexander Oh almost 7 years
    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.
  • Johnny Baloney
    Johnny Baloney about 6 years
    Also press it FOUR times to include non-project related items.
  • Mark
    Mark almost 6 years
    Please include the name of the action in the answer for people with different hotkeys
  • minhas23
    minhas23 over 5 years
    Ctrl + F12 worked nice for me. Intelli IDEA J 2018.2
  • Imam Bux
    Imam Bux over 5 years
    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
  • Moxor
    Moxor over 5 years
    Double shift is very useful, but is not what was asked. The answer of Daniel Deng is the correct one
  • Gustavo Passini
    Gustavo Passini almost 3 years
    For the sake of completeness, in KDE it's CTRL + 0.