What is the shortcut in IntelliJ IDEA to find method / functions?
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
Comments
-
Felipe almost 3 years
I know that Ctrl + N is to find classes and it is very useful. But what about methods?
-
Felipe over 13 yearsThank you very much! And how can I find this option on menus?
-
Felipe over 13 yearsI found it! It is under Go To menu. Easy!
-
Felipe almost 12 yearsnow I use mac. Do you know the equivalent shortcut for mac? Thanks!
-
TJ Seabrooks almost 12 yearsCmnd f12 on mac. I think this is a better answer.
-
Felipe almost 11 yearsDid not work for me this option. Here in Mac is command + option + O
-
Felipe almost 11 yearsCmnd + ALT + O is also very useful on macs, to find symbols.
-
Siddhartha over 10 yearshmmm. 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 over 10 years@Siddhartha, you need to change your config to fit Mac-style shortcuts. But everything changes.
-
user674158 about 10 yearsIt depends on the keymap you choose in "Preference->Keymap" . it seems you choose the "Mac OS X 10.5+"
-
sealskej almost 10 yearsWhat's the name of action to show all members of the current class?
-
Guillaume Husta almost 10 yearsIn fact in Eclipse this is Ctrl+O (Quick Outline). Ctrl+Shift+O is for Organize imports.
-
olafure about 9 yearsIf you type "sudo grep something /" you can also find anything, on your whole computer :)
-
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 about 9 yearsI 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 over 8 yearsThis is what I was looking for
-
dudewad over 8 yearsThis 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 over 8 yearsWhile 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 over 8 yearsThe 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 about 8 yearsWorks on Intellij 15.x version for me. This should be the right answer.
-
software.wikipedia about 8 yearsDoes 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 about 8 yearsI've removed the tutorial URL. Please don't include the URLs that could be considered as spam.
-
Ajak6 over 7 yearsDoes not work for me on mac. Although CMD+ F12 works. Thanks
-
Mahesha999 over 7 yearswhat is difference between this and Ctrl+Alt+Shift+N ?
-
shanwu over 7 years@sealskej it's called "File Structure" on the keymap setting.
-
Lv99Zubat about 7 yearsFor complete clarity, what exactly is the definition of "Symbol" in terms of Android Studio?
-
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 almost 7 yearswhile 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 about 6 yearsAlso press it FOUR times to include non-project related items.
-
Mark almost 6 yearsPlease include the name of the action in the answer for people with different hotkeys
-
minhas23 over 5 yearsCtrl + F12 worked nice for me. Intelli IDEA J 2018.2
-
Imam Bux over 5 yearsI 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 over 5 yearsDouble shift is very useful, but is not what was asked. The answer of Daniel Deng is the correct one
-
Gustavo Passini almost 3 yearsFor the sake of completeness, in KDE it's CTRL + 0.