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

前端 未结 15 1300
终归单人心
终归单人心 2020-11-30 16:07

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

相关标签:
15条回答
  • 2020-11-30 16:42

    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

    0 讨论(0)
  • 2020-11-30 16:43

    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.

    0 讨论(0)
  • 2020-11-30 16:43

    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
    0 讨论(0)
  • 2020-11-30 16:44

    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
    0 讨论(0)
  • 2020-11-30 16:45

    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.

    0 讨论(0)
  • 2020-11-30 16:46

    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

    0 讨论(0)
提交回复
热议问题