In eclipse you can click Ctrl+I at any line, and it'll automatically indent the line or group of lines according to the indentation scheme you chose in the settings.
I'm really missing this feature in Netbeans. Is there any equivalent feature?
I'm aware of Alt+Shift+F but it's not good enough. I want to indent a group of lines, and not all the file.
If your file loses correct formatting, you can reformat the whole file by selecting Source | Reformat Code (Ctrl-Shift-F). If you have any lines selected, the reformatting applies only to those lines. If you have copied code, you can have it inserted with correct formatting by pasting with the Ctrl-Shift-V shortcut.
Use Ctrl + Shift + I will import all the required packages.
Shortcut:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With