Smart multi-line comment editing for C and C++ in VS Code.
Features
- Smart
Enterinside/* ... */and/** ... */ - Repairs blank holes inside multi-line comments
- Smart
Backspacefor empty*lines - Smart delete-line behavior for empty
*lines - Smart
Option+DeleteandCmd+Deleteon macOS for empty*lines - Smart delete-line on the opening
/*line to unwrap the whole multi-line comment - Normalize an existing multi-line comment
- Convert a selection into a multi-line comment
Cmd+//Ctrl+/can wrap a selection as a multi-line comment- Highlight comment keywords such as
TODO,FIXME,BUG,WARN,NOTE,HACK, andPERF
Settings
Multi-line shortcut mode (Cmd+/ / Ctrl+/)
Set these in settings.json:
"cCppSmartMultiLineComments.cCommentType": "multi-line",
"cCppSmartMultiLineComments.cppCommentType": "multi-line"
With this enabled, Cmd+/ on macOS or Ctrl+/ on Windows/Linux:
- inserts
/* */when nothing is selected - removes an empty inline
/* */when the cursor is inside it - wraps a selection as a multi-line comment with
/*and*/on separate lines - unwraps that multi-line comment when the full comment is selected (default behavior)
All settings
cCppSmartMultiLineComments.enableEnterBinding(default:true, options:true|false) Enables smart Enter behavior inside multi-line comments (auto*continuation and gap repair).cCppSmartMultiLineComments.enableBackspaceBinding(default:true, options:true|false) Enables smart deletion for blank*lines (Backspace, plusOption+Delete/Cmd+Deleteon macOS).cCppSmartMultiLineComments.spaceAfterStar(default:true, options:true|false) Generates comment body lines as*instead of*.cCppSmartMultiLineComments.enableKeywordHighlighting(default:true, options:true|false) Highlights multi-line comments that start with keywords likeTODO,FIXME,BUG,WARN,NOTE,HACK,PERF.cCppSmartMultiLineComments.cCommentType(default:line, options:line|multi-line) ControlsCmd+//Ctrl+/behavior in C files (lineormulti-line).cCppSmartMultiLineComments.cppCommentType(default:line, options:line|multi-line) ControlsCmd+//Ctrl+/behavior in C++ files (lineormulti-line).cCppSmartMultiLineComments.selectedWrappedMultiLineCommentAction(default:unwrap, options:unwrap|delete) In multi-line mode, controls whatCmd+//Ctrl+/does when a wrapped multi-line comment is selected.