NetBeans shortcut key for collapsing/expanding a method

Stefanos Kargas picture Stefanos Kargas · Jun 3, 2010 · Viewed 41.6k times · Source

JAVA - NETBEANS

This is an IDE question

I am always working with collapsed methods, because I want to be able to see my methods all together. This is a little time consuming because I have to use the mouse to scroll up to the declaration of the method and click on the - (minus) icon. And then respectively go to the method I want to work on and click on the + (plus) icon.

Is there a way through a keyboard shortcut to do the collapse (and respectively the expand)?

Answer

Peter Tillemans picture Peter Tillemans · Jun 3, 2010

I copied a piece from http://wiki.netbeans.org/KeymapProfileFor60.

The first option is for Win/Lin and the second for Mac.

Collapse (hide) a block                     Ctrl + Minus                 Cmd + Minus
Collapse (hide) a block                     Ctrl + NumPad Minus     
Collapse (hide) all code blocks             Ctrl + Shift + NumPad Minus  Cmd + Shift + Minus
Expand a Collapsed Block (expand-fold)      Ctrl + Plus                  Cmd + Plus
Expand a Collapsed Block (expand-fold)      Ctrl + NumPad Plus  
Expand a Collapsed Block (expand-fold)      Ctrl + Equals                Cmd + Equals
Expand all code blocks (expand-all-folds)   Ctrl + Shift + NumPad Plus  
Expand all code blocks (expand-all-folds)   Ctrl + Shift + Plus          Cmd + Shift + Plus
Expand all code blocks (expand-all-folds)   Ctrl + Shift + Equals        Cmd + Shift + Equals