Accepted answer

there is a hotkey, mapped by default to ctrl+shift+num_keypad_divide.

you can change it to something else via window -> preferences, search for "keys", then for "collapse all".

to open all code blocks the shortcut is ctrl+shift+num_keypad_multiply.

in the eclipse extension pydev, close all code blocks is ctrl + 9

to open all blocks, is ctrl + 0


in case you don't have a separate numpad, you can activate the overlapping numpad using the number lock- this varies with the type of keypad-> fn + numlk for hp

then try ctrl + shift + numpad_divide

should work fine


collapse all : ctrl + shift + /

expand all code blocks : ctrl + *


i noticed few things:

ctrl+/ toggles folding-enabled or -disabled.

it is ctrl+* that expands. ctrl+shift+* collapses just like ctrl+shift+/


shortcuts that worked for me in versions oxygen.2 release (php/windows 7) were

  1. collapse all code blocks: ctrl + shift + numpad_divide
  2. expand all code blocks : ctrl + numpad_multiply


i had the same problem and found out folding can be enabled or disabled, and in my case got disabled somehow.

to solve it, simply right click on the line numbers/breakpoint section (vertical bar in the left of the editor), then under the 'folding' section chose 'enable folding'.

ctrlshift/ should be working fine after.


if you are using pydev in eclipse, its ctrl0 and ctrl9 for collapse all and uncollapse all respectively. ctrl- and ctrl= to collapse individual methods when your cursor is on the line of the method declaration.


right click on the circles +/- sign and under foldings select collapse all


just to sum up:

  1. anycode:
    • ctrl + shift + numpad_divide = collapse all
    • numpad_multiply = exand all
  2. pydev:
    • -ctrl + 0 = collapse all
    • -ctrl + 9 = exand all


ctrl+shift+/ and ctrl+shift+* works great for aptana studio 3.

apart from that you can always use window > preferences > editors > foldings to enable it


right click on the +/- sign and click collapse all or expand all.


if you always want the code collapsed by default, go to windows > preferences. search for "folding". then check all the items under "initially fold these elements".

enter image description here


the question is a bit old, but let me add a different approach. in addition to the above hot-key approaches, there are default preference settings that can be toggled.

as of eclipse galileo (and definitely in my eclipse version: indigo service release 2 build id: 20120216-1857) language specific preferences can open up new files to edit which are already collapsed or expanded.

here is a link to eclipse galileo online docs showing the feature for c/c++: .

in my eclipse indigo i can open the folding preferences window via : menu/ window/ preferences/ java/ editor/ folding and set all options on so i can open files by default that are completely collapsed.


a "collapse all" command exists in recent builds (e.g. 3.2 m6) and is bound to ctrl+shift+num_keypad_divide by default.

you can also configure it in preferences->editor->keys.


in addition to the hotkey, if you right click in the gutter where you see the +/-, there is a context menu item 'folding.' opening the submenu associated with this, you can see a 'collapse all' item. this will also do what you wish.

Related Query

More Query from same tag