IntelliJ IDEA 12.1.0 Web Help

Code blocks have folding toggles at the right edge of the gutter next to each block. When a block is folded, the toggle foldingPlus appears to the left of the first line of the block. When a block is expanded, the toggle foldingMinusStart is shown at the beginning of the block and foldingMinusEnd at its end.

Folding and expanding code blocks works for entire classes, inner and anonymous classes, method bodies, import lists, comments, HTML and XML tags , closures and language injections .

To fold or expand a block of code, do one of the following
  • Click the toggles foldingPlus or foldingMinus.
  • Place the caret within the desired block, and choose Code | Folding | Collapse or Code | Folding | Expand on the main menu, or just press Ctrl+Plus/MinusControl Plus/Minus.
To fold or expand all blocks in a file, do one of the following
  • On the main menu, choose Code | Folding | Collapse All, or Code | Folding | Expand All.
  • Press Ctrl+Shift+Plus/MinusControl Shift Plus/Minus.

    Note

    Pressing Ctrl+Shift+PlusControl Shift Plus once expands all blocks except the imports list. Repeating the keystroke expands the imports.

See Also

Web Resources: