Is there a shortcut in NetBeans to highlight a block of code and comment/uncomment it?
Is there a shortcut in NetBeans to highlight a block of code and comment/uncomment it?
The list of keyboard shortcuts can be found in the NetBeans Wiki.
Turn On/Off Search Result highlights
Alt + Shift + H
Add/remove comment. Should work for all languages
Ctrl + / or in mac ā + /
Also, to have a whole block commented, can be useful the rectangular selection trick as a single "null column" rectangle where we can add any comment character we like (eg. an hash or a slash):
The shortcut in Mac is Ctrl+Shift+R as explained in this thread.
To return to the normal selection just repeat the same shortcut.