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
- collapse all code blocks: ctrl + shift + numpad_divide
- 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:
- ctrl + shift + numpad_divide = collapse all
- numpad_multiply = exand all
- -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.
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.
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.
- Is there a way to collapse all code blocks in Eclipse?
- Is there way to expand all folders in Eclipse project view and search results?
- Is there a way to upgrade eclipse and keep all the installed plugins?
- Is there a way to have Eclipse automatically make all my variables final?
- Is there a way to capitalize the first letter of a value of a variable in Eclipse (Helios) code templates
- Is there a way to copy code from the Eclipse IDE without the rich-text formatting?
- Is there a way to copy code from eclipse including ine numbers
- Is there a way in eclipse to select a region and shift the indentation level of all ines in that region
- Is there any way in Eclipse to format a code that contains divs in the way Netbeans do it?
- Is there a way in eclipse to change the alignment of parenthesis of all methods, loops, if statements, etc. at once?
- Is there a way to connect Eclipse with Jira and Mercurial - or... would Code Beamer work?
- Eclipse code formatting: is there a way to add "section lines"
- is there any way I can apply this onMouseEntered to all the buttons in the FXML file without actually writing a separate code for each one?
- Is there any way to hide certain snippet of code while compiling in Eclipse 3.7?
- Is there a way to tell eclipse to save ALL open editors when running or debugging?
- Is there a way I can copy code from Eclipse IDE with line numbers so I can paste it into a word document?
- Is there a way to show a layout when open it's implement code in eclipse adt such as assistant editor of xcode?
- Is there a way to tell eclipse to ignore warnings from specific code folders?
- Is there a way I can skip tracing through the code in third party jars in eclipse debug mode
- Is there a way in eclipse to auto generate references/fields into a class for all specified views in a layout?
- Is there a way to get eclipse code completion to filter options on text typed anywhere in a word rather than just the start?
- Is there a way to get eclipse not to open/show auto generated code
- Is there a way to auto generate boilerplate code for pojo mapping without hiding implementation in eclipse
- Is there a way to quickly capitalize the variable name in Eclipse
- How to collapse blocks of code in Eclipse?
- Is there a way to fold eclipse sub-blocks like an "if" statement?
- Is there a way to hide Maven 2 "target/" folder in Eclipse 3?
- Is there any way to integrate Eclipse with Gradle in Android project?
- Is there any way of configuring Eclipse IDE proxy settings via an autoproxy configuration script?
- Is there any way to fold/collapse regional code in Eclipse?
More Query from same tag
- Using intellij to debug eclipse plugins
- IntelliJ/Eclipse not respecting minimum SDK version for Android app
- JNI Java-to-C++ call works when built in Eclipse, but not when built via command line
- PhoneGap 2.0 Upgrade Errors - JSCallback Error / Could not find class
- Cannot connect to secure TFS 2015 server with Rad (Eclipse)
- Trying to put java code into Eclipse, to make android app?
- Boost with eclipse cannot find thread library
- C++ HelloWorld not printing correctly
- How to fix blurry Swing elements in Eclipse
- call c/c++ DLL from Java in Eclipse IDE
- What is the reason for these error messages?
- Problem with configuring log4j2.properties into spring boot( using gradle)
- Tell eclipse to reload environment variables
- Getting Jetty & Maven to work form TextMate
- Findbugs using jsr305 annotations in eclipse is not finding bugs
- How do I configure project-specific 'Build automatically' setting in Eclipse?
- Getting error while creating an instance of JSONObject
- Can't disable the logs Spark eclipse scala
- "java.lang.ClassNotFoundException: com.mysql.jdbc.Driver" error on creating a Dynamic web project
- How to make javadoc.jar take priority over javadoc in sources.jar?
- Google App-engine installation issue in Eclipse Luna on Windows 7
- How to ignore auto-generated classes in eclipse debugger?
- Eclipse mars is too slow.. Always busy in scanning classpath
- How to make a Java project the default in Eclipse
- Running Ant Build.xml getting: Java Virtual Machine Launcher: Could not find the main class. Program will exit
- Maven option is not found in Eclipse
- How to hook into the internal Eclipse browser?
- JavaFX FXML invalid type
- Debugging Maven Eclipse projects, and stepping through the code?