Skip to content

Commenting

Action macOS Windows / Linux Result
Code | Comment with Line Comment ⌘/ Ctrl+/ Adds or removes // at the start of the current line, or of every selected line
Code | Comment with Block Comment ⌥⌘/ Ctrl+Shift+/ Wraps the selection in /* … */, or removes the block comment around the caret

Both actions toggle: running them again on commented code removes the comment. After Comment with Line Comment the caret moves to the next line, so you can comment several lines in a row by pressing the shortcut repeatedly.

Two selected lines — before
wire a;
wire b;
After Comment with Line Comment
//wire a;
//wire b;
  1. Open rtl/counter.sv from the sample project and put the caret on the line state_t state;.
  2. Press ⌘/ (Ctrl+/). // is added at the start of the line and the caret moves to the next line.
  3. Move the caret back up to the commented line and press ⌘/ (Ctrl+/) again. The comment is removed.
  4. Select the whole assign done = is_done(state); statement and press ⌥⌘/ (Ctrl+Shift+/). It becomes /*assign done = is_done(state);*/. Press it again to remove the block comment.