Is there a way to collapse all code blocks in Eclipse?

Viewed 246215

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.

16 Answers

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

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.

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

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+/

i was using lapop numpad was orange color which will get enable using function (Fn) button ...so try

shift + crtl + fn + (see where is divide) in my case its on 0

Related