Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>C/C++ Smart Multi-Line CommentsNew to Visual Studio Code? Get it now.
C/C++ Smart Multi-Line Comments

C/C++ Smart Multi-Line Comments

Hasan Berk Zengin

|
4 installs
| (1) | Free
Better multi-line comment support in C and C++
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

C/C++ Smart Multi-Line Comments

Smart multi-line comment editing for C and C++ in VS Code.

Features

  • Smart Enter inside /* ... */ and /** ... */
  • Repairs blank holes inside multi-line comments
  • Smart Backspace for empty * lines
  • Smart delete-line behavior for empty * lines
  • Smart Option+Delete and Cmd+Delete on 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, and PERF

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, plus Option+Delete / Cmd+Delete on 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 like TODO, FIXME, BUG, WARN, NOTE, HACK, PERF.
  • cCppSmartMultiLineComments.cCommentType (default: line, options: line | multi-line) Controls Cmd+/ / Ctrl+/ behavior in C files (line or multi-line).
  • cCppSmartMultiLineComments.cppCommentType (default: line, options: line | multi-line) Controls Cmd+/ / Ctrl+/ behavior in C++ files (line or multi-line).
  • cCppSmartMultiLineComments.selectedWrappedMultiLineCommentAction (default: unwrap, options: unwrap | delete) In multi-line mode, controls what Cmd+/ / Ctrl+/ does when a wrapped multi-line comment is selected.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft