How to comment a block in Eclipse?

Ctrl/ to toggle “//” comments and CtrlShift/ to toggle “/* */” comments. At least for Java, anyway – other tooling may have different shortcuts.

Ctrl\ will remove a block of either comment, but won’t add comments.

Note: As for Eclipse CDT 4.4.2, CtrlShift/ will not uncomment a “/* */” block comment. Use CtrlShift\ in that case.

EDIT: It’s Ctrl on a PC, but on a Mac the shortcuts may all be Cmd instead. I don’t have a Mac myself, so can’t easily check.

Leave a Comment