Jetbrains / Intellij keyboard shortcut to collapse all methods












154















I'm working on some legacy code that has a class that is 10,000+ lines of code and has 100s of methods. Is there a shortcut for any jetbrains IDE (since the shortcut would likely be shared across all of them) to collapse all the methods / functions so that only the method signatures are shown?



something like this:



public String myMethod(String arg1, int arg2){...}

public String mySecondMethod(String arg1, int arg2){...}









share|improve this question




















  • 9





    You may take a look at intellij code folding shortcuts. I guess that Ctrl+Shift+Minus is what you need.

    – lifus
    May 13 '13 at 16:33











  • YEAHHHH. I didn't know it was called code folding so i couldn't find it. Thanks!

    – Brad
    May 13 '13 at 16:34






  • 2





    I would be tempted to downvote except I almost cried when you said "a class that is 10,000+ lines of code and has around 100s of methods" so +1 for trying.

    – Peter Lawrey
    May 13 '13 at 16:37











  • ha. i would be too but it ain't my fault. I inherited this

    – Brad
    May 13 '13 at 16:39








  • 1





    I realize this doesn't answer the question as asked, but Ctrl-F12 will open a navigator to hop between methods, etc. (You can narrow down the list of methods by typing in this Structure View as well.) The Structure Pane (Alt-7) adds more options. This might be a more effective way of exploring files with large numbers of methods, so I leave the suggestion here for future googlers.

    – kghastie
    Aug 30 '17 at 14:27


















154















I'm working on some legacy code that has a class that is 10,000+ lines of code and has 100s of methods. Is there a shortcut for any jetbrains IDE (since the shortcut would likely be shared across all of them) to collapse all the methods / functions so that only the method signatures are shown?



something like this:



public String myMethod(String arg1, int arg2){...}

public String mySecondMethod(String arg1, int arg2){...}









share|improve this question




















  • 9





    You may take a look at intellij code folding shortcuts. I guess that Ctrl+Shift+Minus is what you need.

    – lifus
    May 13 '13 at 16:33











  • YEAHHHH. I didn't know it was called code folding so i couldn't find it. Thanks!

    – Brad
    May 13 '13 at 16:34






  • 2





    I would be tempted to downvote except I almost cried when you said "a class that is 10,000+ lines of code and has around 100s of methods" so +1 for trying.

    – Peter Lawrey
    May 13 '13 at 16:37











  • ha. i would be too but it ain't my fault. I inherited this

    – Brad
    May 13 '13 at 16:39








  • 1





    I realize this doesn't answer the question as asked, but Ctrl-F12 will open a navigator to hop between methods, etc. (You can narrow down the list of methods by typing in this Structure View as well.) The Structure Pane (Alt-7) adds more options. This might be a more effective way of exploring files with large numbers of methods, so I leave the suggestion here for future googlers.

    – kghastie
    Aug 30 '17 at 14:27
















154












154








154


20






I'm working on some legacy code that has a class that is 10,000+ lines of code and has 100s of methods. Is there a shortcut for any jetbrains IDE (since the shortcut would likely be shared across all of them) to collapse all the methods / functions so that only the method signatures are shown?



something like this:



public String myMethod(String arg1, int arg2){...}

public String mySecondMethod(String arg1, int arg2){...}









share|improve this question
















I'm working on some legacy code that has a class that is 10,000+ lines of code and has 100s of methods. Is there a shortcut for any jetbrains IDE (since the shortcut would likely be shared across all of them) to collapse all the methods / functions so that only the method signatures are shown?



something like this:



public String myMethod(String arg1, int arg2){...}

public String mySecondMethod(String arg1, int arg2){...}






intellij-idea ide phpstorm keyboard-shortcuts






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 9 at 2:38









Sharan Duggirala

88621340




88621340










asked May 13 '13 at 16:28









BradBrad

3,01722339




3,01722339








  • 9





    You may take a look at intellij code folding shortcuts. I guess that Ctrl+Shift+Minus is what you need.

    – lifus
    May 13 '13 at 16:33











  • YEAHHHH. I didn't know it was called code folding so i couldn't find it. Thanks!

    – Brad
    May 13 '13 at 16:34






  • 2





    I would be tempted to downvote except I almost cried when you said "a class that is 10,000+ lines of code and has around 100s of methods" so +1 for trying.

    – Peter Lawrey
    May 13 '13 at 16:37











  • ha. i would be too but it ain't my fault. I inherited this

    – Brad
    May 13 '13 at 16:39








  • 1





    I realize this doesn't answer the question as asked, but Ctrl-F12 will open a navigator to hop between methods, etc. (You can narrow down the list of methods by typing in this Structure View as well.) The Structure Pane (Alt-7) adds more options. This might be a more effective way of exploring files with large numbers of methods, so I leave the suggestion here for future googlers.

    – kghastie
    Aug 30 '17 at 14:27
















  • 9





    You may take a look at intellij code folding shortcuts. I guess that Ctrl+Shift+Minus is what you need.

    – lifus
    May 13 '13 at 16:33











  • YEAHHHH. I didn't know it was called code folding so i couldn't find it. Thanks!

    – Brad
    May 13 '13 at 16:34






  • 2





    I would be tempted to downvote except I almost cried when you said "a class that is 10,000+ lines of code and has around 100s of methods" so +1 for trying.

    – Peter Lawrey
    May 13 '13 at 16:37











  • ha. i would be too but it ain't my fault. I inherited this

    – Brad
    May 13 '13 at 16:39








  • 1





    I realize this doesn't answer the question as asked, but Ctrl-F12 will open a navigator to hop between methods, etc. (You can narrow down the list of methods by typing in this Structure View as well.) The Structure Pane (Alt-7) adds more options. This might be a more effective way of exploring files with large numbers of methods, so I leave the suggestion here for future googlers.

    – kghastie
    Aug 30 '17 at 14:27










9




9





You may take a look at intellij code folding shortcuts. I guess that Ctrl+Shift+Minus is what you need.

– lifus
May 13 '13 at 16:33





You may take a look at intellij code folding shortcuts. I guess that Ctrl+Shift+Minus is what you need.

– lifus
May 13 '13 at 16:33













YEAHHHH. I didn't know it was called code folding so i couldn't find it. Thanks!

– Brad
May 13 '13 at 16:34





YEAHHHH. I didn't know it was called code folding so i couldn't find it. Thanks!

– Brad
May 13 '13 at 16:34




2




2





I would be tempted to downvote except I almost cried when you said "a class that is 10,000+ lines of code and has around 100s of methods" so +1 for trying.

– Peter Lawrey
May 13 '13 at 16:37





I would be tempted to downvote except I almost cried when you said "a class that is 10,000+ lines of code and has around 100s of methods" so +1 for trying.

– Peter Lawrey
May 13 '13 at 16:37













ha. i would be too but it ain't my fault. I inherited this

– Brad
May 13 '13 at 16:39







ha. i would be too but it ain't my fault. I inherited this

– Brad
May 13 '13 at 16:39






1




1





I realize this doesn't answer the question as asked, but Ctrl-F12 will open a navigator to hop between methods, etc. (You can narrow down the list of methods by typing in this Structure View as well.) The Structure Pane (Alt-7) adds more options. This might be a more effective way of exploring files with large numbers of methods, so I leave the suggestion here for future googlers.

– kghastie
Aug 30 '17 at 14:27







I realize this doesn't answer the question as asked, but Ctrl-F12 will open a navigator to hop between methods, etc. (You can narrow down the list of methods by typing in this Structure View as well.) The Structure Pane (Alt-7) adds more options. This might be a more effective way of exploring files with large numbers of methods, so I leave the suggestion here for future googlers.

– kghastie
Aug 30 '17 at 14:27














5 Answers
5






active

oldest

votes


















290














You may take a look at intellij code folding shortcuts. I guess that Ctrl+Shift+- is exactly what you need.



For mac, you can use, Command+Shift+-






share|improve this answer


























  • A command that does not recursively collapse everything inside the methods too would be nice.

    – trinity420
    Jul 21 '18 at 11:33











  • Ctrl + - : collapse current method

    – Ali_dev
    Aug 29 '18 at 4:10





















55














The above suggestion of Ctrl+Shift+- code folds all code blocks recursively. I only wanted to fold the methods for my classes.




Code > Folding > Expand all to level > 1



I managed to achieve this by using the menu option Code > Folding > Expand all to level > 1.



I re-assigned it to Ctrl+NumPad-1 which gives me a quick way to collapse my classes down to their methods.



This works at the 'block level' of the file and assumes that you have classes defined at the top level of your file, which works for code such as PHP but not for JavaScript (nested closures etc.)






share|improve this answer





















  • 2





    This should be the accepted answer IMO. It solves the problem in 1 step and solves it exactly as asked. If instead you the do the accepted answer you will be folding everything that can be folded and then unfolding to see your methods. I've been doing the latter and it's not that time consuming, but it's nice to know I can skip some steps with the former from this post. Thanks!

    – John Pancoast
    Oct 8 '17 at 14:31













  • Nice, this does it. The only problem im facing now is I cant do it by pressing keyboard buttons as I have a MacbookPro with no numpad. Will have to Google on how to assign custom keys i suppose. Sigh.

    – CodeGodie
    Jan 12 '18 at 23:16











  • IntelliJ has a default keymap for this: Ctrl + NumPad-* followed by the level of folding you want, entered on the NumPad.

    – Matthew Cliatt
    Jan 25 at 19:13





















20














go to menu option Code > Folding to access all code folding related options and their shortcuts.






share|improve this answer





















  • 1





    This is espacially useful if you use another keymap (such as the eclipse keymap).

    – Magnilex
    Dec 2 '16 at 12:20



















2














@precastic's answer above is, imo, the right idea.



Worth noting that in IDEA 2018.2 (and surely other nearby versions) there are default keyboard shortcuts for this: (showing Mac, see Code > Folding > Expand All to Level for your system):



Cmd+Option+Keypad *, 1 - expand all to level 1
Cmd+Option+Keypad *, 2 - expand all to level 2

...
Cmd+Option+Keypad *, 5 - expand all to level 5



Note: these are "second stroke" shortcuts. First press Cmd+Option+*, then release, then hit the number you want.






share|improve this answer
























  • For all non mac people Cmd is Ctrl and Option is Shift

    – desertSniper87
    Jan 3 at 10:17





















0














You Can Go To setting > editor > general > code folding and check "show code folding outline" .






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f16526860%2fjetbrains-intellij-keyboard-shortcut-to-collapse-all-methods%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    5 Answers
    5






    active

    oldest

    votes








    5 Answers
    5






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    290














    You may take a look at intellij code folding shortcuts. I guess that Ctrl+Shift+- is exactly what you need.



    For mac, you can use, Command+Shift+-






    share|improve this answer


























    • A command that does not recursively collapse everything inside the methods too would be nice.

      – trinity420
      Jul 21 '18 at 11:33











    • Ctrl + - : collapse current method

      – Ali_dev
      Aug 29 '18 at 4:10


















    290














    You may take a look at intellij code folding shortcuts. I guess that Ctrl+Shift+- is exactly what you need.



    For mac, you can use, Command+Shift+-






    share|improve this answer


























    • A command that does not recursively collapse everything inside the methods too would be nice.

      – trinity420
      Jul 21 '18 at 11:33











    • Ctrl + - : collapse current method

      – Ali_dev
      Aug 29 '18 at 4:10
















    290












    290








    290







    You may take a look at intellij code folding shortcuts. I guess that Ctrl+Shift+- is exactly what you need.



    For mac, you can use, Command+Shift+-






    share|improve this answer















    You may take a look at intellij code folding shortcuts. I guess that Ctrl+Shift+- is exactly what you need.



    For mac, you can use, Command+Shift+-







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jan 5 at 23:20









    LuminousNutria

    764323




    764323










    answered May 13 '13 at 16:37









    lifuslifus

    4,89011321




    4,89011321













    • A command that does not recursively collapse everything inside the methods too would be nice.

      – trinity420
      Jul 21 '18 at 11:33











    • Ctrl + - : collapse current method

      – Ali_dev
      Aug 29 '18 at 4:10





















    • A command that does not recursively collapse everything inside the methods too would be nice.

      – trinity420
      Jul 21 '18 at 11:33











    • Ctrl + - : collapse current method

      – Ali_dev
      Aug 29 '18 at 4:10



















    A command that does not recursively collapse everything inside the methods too would be nice.

    – trinity420
    Jul 21 '18 at 11:33





    A command that does not recursively collapse everything inside the methods too would be nice.

    – trinity420
    Jul 21 '18 at 11:33













    Ctrl + - : collapse current method

    – Ali_dev
    Aug 29 '18 at 4:10







    Ctrl + - : collapse current method

    – Ali_dev
    Aug 29 '18 at 4:10















    55














    The above suggestion of Ctrl+Shift+- code folds all code blocks recursively. I only wanted to fold the methods for my classes.




    Code > Folding > Expand all to level > 1



    I managed to achieve this by using the menu option Code > Folding > Expand all to level > 1.



    I re-assigned it to Ctrl+NumPad-1 which gives me a quick way to collapse my classes down to their methods.



    This works at the 'block level' of the file and assumes that you have classes defined at the top level of your file, which works for code such as PHP but not for JavaScript (nested closures etc.)






    share|improve this answer





















    • 2





      This should be the accepted answer IMO. It solves the problem in 1 step and solves it exactly as asked. If instead you the do the accepted answer you will be folding everything that can be folded and then unfolding to see your methods. I've been doing the latter and it's not that time consuming, but it's nice to know I can skip some steps with the former from this post. Thanks!

      – John Pancoast
      Oct 8 '17 at 14:31













    • Nice, this does it. The only problem im facing now is I cant do it by pressing keyboard buttons as I have a MacbookPro with no numpad. Will have to Google on how to assign custom keys i suppose. Sigh.

      – CodeGodie
      Jan 12 '18 at 23:16











    • IntelliJ has a default keymap for this: Ctrl + NumPad-* followed by the level of folding you want, entered on the NumPad.

      – Matthew Cliatt
      Jan 25 at 19:13


















    55














    The above suggestion of Ctrl+Shift+- code folds all code blocks recursively. I only wanted to fold the methods for my classes.




    Code > Folding > Expand all to level > 1



    I managed to achieve this by using the menu option Code > Folding > Expand all to level > 1.



    I re-assigned it to Ctrl+NumPad-1 which gives me a quick way to collapse my classes down to their methods.



    This works at the 'block level' of the file and assumes that you have classes defined at the top level of your file, which works for code such as PHP but not for JavaScript (nested closures etc.)






    share|improve this answer





















    • 2





      This should be the accepted answer IMO. It solves the problem in 1 step and solves it exactly as asked. If instead you the do the accepted answer you will be folding everything that can be folded and then unfolding to see your methods. I've been doing the latter and it's not that time consuming, but it's nice to know I can skip some steps with the former from this post. Thanks!

      – John Pancoast
      Oct 8 '17 at 14:31













    • Nice, this does it. The only problem im facing now is I cant do it by pressing keyboard buttons as I have a MacbookPro with no numpad. Will have to Google on how to assign custom keys i suppose. Sigh.

      – CodeGodie
      Jan 12 '18 at 23:16











    • IntelliJ has a default keymap for this: Ctrl + NumPad-* followed by the level of folding you want, entered on the NumPad.

      – Matthew Cliatt
      Jan 25 at 19:13
















    55












    55








    55







    The above suggestion of Ctrl+Shift+- code folds all code blocks recursively. I only wanted to fold the methods for my classes.




    Code > Folding > Expand all to level > 1



    I managed to achieve this by using the menu option Code > Folding > Expand all to level > 1.



    I re-assigned it to Ctrl+NumPad-1 which gives me a quick way to collapse my classes down to their methods.



    This works at the 'block level' of the file and assumes that you have classes defined at the top level of your file, which works for code such as PHP but not for JavaScript (nested closures etc.)






    share|improve this answer















    The above suggestion of Ctrl+Shift+- code folds all code blocks recursively. I only wanted to fold the methods for my classes.




    Code > Folding > Expand all to level > 1



    I managed to achieve this by using the menu option Code > Folding > Expand all to level > 1.



    I re-assigned it to Ctrl+NumPad-1 which gives me a quick way to collapse my classes down to their methods.



    This works at the 'block level' of the file and assumes that you have classes defined at the top level of your file, which works for code such as PHP but not for JavaScript (nested closures etc.)







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jan 1 at 22:51









    Basil Bourque

    113k29386547




    113k29386547










    answered Mar 7 '16 at 10:27









    PrecasticPrecastic

    2,3121726




    2,3121726








    • 2





      This should be the accepted answer IMO. It solves the problem in 1 step and solves it exactly as asked. If instead you the do the accepted answer you will be folding everything that can be folded and then unfolding to see your methods. I've been doing the latter and it's not that time consuming, but it's nice to know I can skip some steps with the former from this post. Thanks!

      – John Pancoast
      Oct 8 '17 at 14:31













    • Nice, this does it. The only problem im facing now is I cant do it by pressing keyboard buttons as I have a MacbookPro with no numpad. Will have to Google on how to assign custom keys i suppose. Sigh.

      – CodeGodie
      Jan 12 '18 at 23:16











    • IntelliJ has a default keymap for this: Ctrl + NumPad-* followed by the level of folding you want, entered on the NumPad.

      – Matthew Cliatt
      Jan 25 at 19:13
















    • 2





      This should be the accepted answer IMO. It solves the problem in 1 step and solves it exactly as asked. If instead you the do the accepted answer you will be folding everything that can be folded and then unfolding to see your methods. I've been doing the latter and it's not that time consuming, but it's nice to know I can skip some steps with the former from this post. Thanks!

      – John Pancoast
      Oct 8 '17 at 14:31













    • Nice, this does it. The only problem im facing now is I cant do it by pressing keyboard buttons as I have a MacbookPro with no numpad. Will have to Google on how to assign custom keys i suppose. Sigh.

      – CodeGodie
      Jan 12 '18 at 23:16











    • IntelliJ has a default keymap for this: Ctrl + NumPad-* followed by the level of folding you want, entered on the NumPad.

      – Matthew Cliatt
      Jan 25 at 19:13










    2




    2





    This should be the accepted answer IMO. It solves the problem in 1 step and solves it exactly as asked. If instead you the do the accepted answer you will be folding everything that can be folded and then unfolding to see your methods. I've been doing the latter and it's not that time consuming, but it's nice to know I can skip some steps with the former from this post. Thanks!

    – John Pancoast
    Oct 8 '17 at 14:31







    This should be the accepted answer IMO. It solves the problem in 1 step and solves it exactly as asked. If instead you the do the accepted answer you will be folding everything that can be folded and then unfolding to see your methods. I've been doing the latter and it's not that time consuming, but it's nice to know I can skip some steps with the former from this post. Thanks!

    – John Pancoast
    Oct 8 '17 at 14:31















    Nice, this does it. The only problem im facing now is I cant do it by pressing keyboard buttons as I have a MacbookPro with no numpad. Will have to Google on how to assign custom keys i suppose. Sigh.

    – CodeGodie
    Jan 12 '18 at 23:16





    Nice, this does it. The only problem im facing now is I cant do it by pressing keyboard buttons as I have a MacbookPro with no numpad. Will have to Google on how to assign custom keys i suppose. Sigh.

    – CodeGodie
    Jan 12 '18 at 23:16













    IntelliJ has a default keymap for this: Ctrl + NumPad-* followed by the level of folding you want, entered on the NumPad.

    – Matthew Cliatt
    Jan 25 at 19:13







    IntelliJ has a default keymap for this: Ctrl + NumPad-* followed by the level of folding you want, entered on the NumPad.

    – Matthew Cliatt
    Jan 25 at 19:13













    20














    go to menu option Code > Folding to access all code folding related options and their shortcuts.






    share|improve this answer





















    • 1





      This is espacially useful if you use another keymap (such as the eclipse keymap).

      – Magnilex
      Dec 2 '16 at 12:20
















    20














    go to menu option Code > Folding to access all code folding related options and their shortcuts.






    share|improve this answer





















    • 1





      This is espacially useful if you use another keymap (such as the eclipse keymap).

      – Magnilex
      Dec 2 '16 at 12:20














    20












    20








    20







    go to menu option Code > Folding to access all code folding related options and their shortcuts.






    share|improve this answer















    go to menu option Code > Folding to access all code folding related options and their shortcuts.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Aug 16 '18 at 9:24

























    answered May 18 '16 at 11:09









    Rahul TiwariRahul Tiwari

    4,30612453




    4,30612453








    • 1





      This is espacially useful if you use another keymap (such as the eclipse keymap).

      – Magnilex
      Dec 2 '16 at 12:20














    • 1





      This is espacially useful if you use another keymap (such as the eclipse keymap).

      – Magnilex
      Dec 2 '16 at 12:20








    1




    1





    This is espacially useful if you use another keymap (such as the eclipse keymap).

    – Magnilex
    Dec 2 '16 at 12:20





    This is espacially useful if you use another keymap (such as the eclipse keymap).

    – Magnilex
    Dec 2 '16 at 12:20











    2














    @precastic's answer above is, imo, the right idea.



    Worth noting that in IDEA 2018.2 (and surely other nearby versions) there are default keyboard shortcuts for this: (showing Mac, see Code > Folding > Expand All to Level for your system):



    Cmd+Option+Keypad *, 1 - expand all to level 1
    Cmd+Option+Keypad *, 2 - expand all to level 2

    ...
    Cmd+Option+Keypad *, 5 - expand all to level 5



    Note: these are "second stroke" shortcuts. First press Cmd+Option+*, then release, then hit the number you want.






    share|improve this answer
























    • For all non mac people Cmd is Ctrl and Option is Shift

      – desertSniper87
      Jan 3 at 10:17


















    2














    @precastic's answer above is, imo, the right idea.



    Worth noting that in IDEA 2018.2 (and surely other nearby versions) there are default keyboard shortcuts for this: (showing Mac, see Code > Folding > Expand All to Level for your system):



    Cmd+Option+Keypad *, 1 - expand all to level 1
    Cmd+Option+Keypad *, 2 - expand all to level 2

    ...
    Cmd+Option+Keypad *, 5 - expand all to level 5



    Note: these are "second stroke" shortcuts. First press Cmd+Option+*, then release, then hit the number you want.






    share|improve this answer
























    • For all non mac people Cmd is Ctrl and Option is Shift

      – desertSniper87
      Jan 3 at 10:17
















    2












    2








    2







    @precastic's answer above is, imo, the right idea.



    Worth noting that in IDEA 2018.2 (and surely other nearby versions) there are default keyboard shortcuts for this: (showing Mac, see Code > Folding > Expand All to Level for your system):



    Cmd+Option+Keypad *, 1 - expand all to level 1
    Cmd+Option+Keypad *, 2 - expand all to level 2

    ...
    Cmd+Option+Keypad *, 5 - expand all to level 5



    Note: these are "second stroke" shortcuts. First press Cmd+Option+*, then release, then hit the number you want.






    share|improve this answer













    @precastic's answer above is, imo, the right idea.



    Worth noting that in IDEA 2018.2 (and surely other nearby versions) there are default keyboard shortcuts for this: (showing Mac, see Code > Folding > Expand All to Level for your system):



    Cmd+Option+Keypad *, 1 - expand all to level 1
    Cmd+Option+Keypad *, 2 - expand all to level 2

    ...
    Cmd+Option+Keypad *, 5 - expand all to level 5



    Note: these are "second stroke" shortcuts. First press Cmd+Option+*, then release, then hit the number you want.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 16 '18 at 15:22









    overthinkoverthink

    19.9k35665




    19.9k35665













    • For all non mac people Cmd is Ctrl and Option is Shift

      – desertSniper87
      Jan 3 at 10:17





















    • For all non mac people Cmd is Ctrl and Option is Shift

      – desertSniper87
      Jan 3 at 10:17



















    For all non mac people Cmd is Ctrl and Option is Shift

    – desertSniper87
    Jan 3 at 10:17







    For all non mac people Cmd is Ctrl and Option is Shift

    – desertSniper87
    Jan 3 at 10:17













    0














    You Can Go To setting > editor > general > code folding and check "show code folding outline" .






    share|improve this answer




























      0














      You Can Go To setting > editor > general > code folding and check "show code folding outline" .






      share|improve this answer


























        0












        0








        0







        You Can Go To setting > editor > general > code folding and check "show code folding outline" .






        share|improve this answer













        You Can Go To setting > editor > general > code folding and check "show code folding outline" .







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Sep 15 '18 at 9:07









        Meysam JafariMeysam Jafari

        62




        62






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f16526860%2fjetbrains-intellij-keyboard-shortcut-to-collapse-all-methods%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Monofisismo

            Angular Downloading a file using contenturl with Basic Authentication

            Olmecas