score:881

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

score: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

score:0

collapse all : ctrl + shift + /

expand all code blocks : ctrl + *

score:0

i noticed few things:

ctrl+/ toggles folding-enabled or -disabled.

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

score:1

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

score:3

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.

score:4

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.

score:4

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

score:5

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

score:8

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

score:9

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

score:9

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

score:11

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++: http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_folding.htm .

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.

score:29

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.

score:147

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