IntelliJ IDEA 12.1.0 Web Help

You can comment or uncomment the current line or selected block of source code.

Commenting feature extends to all supported file types. For the custom file types, you can define line and block comments characters, as described in the section Creating and Registering File Types.

To comment or uncomment the current line of code, do one of the following
  • On the main menu, choose Code | Comment with Line Comment.
  • Press Ctrl+Slash or Ctrl+NumPad /Ctrl+Slash or Ctrl+NumPad /Ctrl+Slash or Ctrl+NumPad /Ctrl+Slash or Ctrl+NumPad /Alt+SemicolonCtrl+Slash or Ctrl+NumPad /Ctrl+Slash, Ctrl+NumPad / or Ctrl+ColonCtrl+Slash, Ctrl+NumPad / or Ctrl+Shift+CCtrl+Slash or Ctrl+NumPad /Meta Slash or Meta NumPad /Meta Slash or Meta NumPad /Meta Slash or Meta NumPad /.

    comment1.png

To add or remove a block comment, do one of the following
  • On the main menu, choose Code | Comment with Block Comment.
  • Press Ctrl+Shift+Slash or Ctrl+Shift+NumPad /Ctrl+Shift+Slash or Ctrl+Shift+NumPad /Ctrl+Shift+Slash or Ctrl+Shift+NumPad /Ctrl+Shift+Slash or Ctrl+Shift+NumPad /Ctrl+Shift+Slash or Ctrl+Shift+NumPad /Ctrl+Shift+Slash or Ctrl+Shift+NumPad /Ctrl+Shift+Slash, Ctrl+Shift+NumPad / or Ctrl+Shift+ColonCtrl+Shift+Slash or Ctrl+Shift+NumPad /Ctrl+Shift+SlashControl Shift Slash, Control Shift NumPad /, Meta Shift Slash or Meta Shift NumPad /Control Shift Slash, Control Shift NumPad /, Meta Shift Slash or Meta Shift NumPad /Control Shift Slash.

    comment2.png

See Also

Procedures:

Reference:

Web Resources: