- Windows: Alt+Shift+F
- Mac OS X: Ctrl+Shift+F (note: it’s Ctrl and not ⌘)
On using above shortcut, NetBeans indents your selection. If nothing’s selected, it indents the whole file.
You can even format multiple files/folders at a time! In the
Projects window/sidebar, if you select one or more folders or files and use the shortcut, NetBeans asks “Recursively format selected files and folders?“. Pressing OK will recursively format all the selected files/folders.
Above shortcuts works on NetBeans from versions 7 to 12.