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.
wire a;wire b;//wire a;//wire b;Try it
Section titled “Try it”- Open
rtl/counter.svfrom the sample project and put the caret on the linestate_t state;. - Press ⌘/ (Ctrl+/).
//is added at the start of the line and the caret moves to the next line. - Move the caret back up to the commented line and press ⌘/ (Ctrl+/) again. The comment is removed.
- 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.