Eclipse has that "+/-" on the left to expand and collapse blocks of code.
I've got tens of thousands of lines to go through and would really like to just collapse everything, and selectively expand blocks to look at them.
Eclipse has that "+/-" on the left to expand and collapse blocks of code.
I've got tens of thousands of lines to go through and would really like to just collapse everything, and selectively expand blocks to look at them.
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
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.
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.