Does anybody know a shortcut to fold/unfold (collapse/expand) al开发者_JAVA百科l classes/methods in a php file using netbeans?
To Collapse: Ctrl+Shift+Minus (on the keypad)
To Expand: Ctrl+Shift+Plus (on the keypad)
This works regardless of what language your using, (Tested on PHP, HTML, CSS & Javascript)
But you can find out the keyboard shortcuts easily yourself, and even change them:
- Open the Options Dialog (Tools -> Options)
- Then Select Keymap
- Enter "
Collapse
" into the input field labelled "Search
" and all shortcuts for that action are displayed. You can do the same for "Expand All
"
I found the Collapse All function to be a pain because it even collapses the nested blocks inside of your methods. There seems to be no collapse methods shortcut.
If you are like me and just want the methods and comments collapsed by default this can be configured in the preferences.
Under Editor->Folding in your Preferences click on the language dropdown and select PHP.
Check the 'Functions and methods' checkbox.
Check the 'PHPDoc documentation' checkbox.
This will probably yield the result you are looking for.
I also like to uncheck the 'Show summary' checkbox to reduce visual noise.
You can still use the Expand All shortcut key as described in the other post if you wish to see everything.
精彩评论