Right click on the circles +/- sign and under Foldings select Collapse All
Shortcuts that worked for me in Versions Oxygen.2 Release (PHP/WINDOWS 7) were
I noticed few things:
Ctrl+/ toggles Folding-enabled or -disabled.
It is Ctrl+* that expands. Ctrl+Shift+* collapses just like Ctrl+Shift+/
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
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.
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.
Collapse all : CTRL + SHIFT + /
Expand all code blocks : CTRL + *
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
Just to sum up:
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.
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.
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.
Right click on the +/- sign and click collapse all or expand all.
Source: Stackoverflow.com