Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>42-comment toggleNew to Visual Studio Code? Get it now.
42-comment toggle

42-comment toggle

asakli

|
1 install
| (0) | Free
42-style block comments: comment and uncomment with one key (fork of nasanov/42-comment)
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

42-comment toggle

42-style block comments that toggle: one key comments, the same key uncomments.

Fork of 42-comment by nasanov, which only comments.

Features

int	main(void)
{
	return (0);
}

turns into:

/*
** int	main(void)
** {
** 	return (0);
** }
*/

and pressing the shortcut again turns it back.

  • Comment: select the lines and run the command. The whole lines are taken, like the original.
  • Uncomment: select the block, or just put the cursor anywhere inside it, and run the command.
  • Empty lines become ** with no trailing space, so norminette doesn't complain.
  • Blocks made by the original 42-comment (** on empty lines) also uncomment.
  • Works with several cursors, and keeps the file's line endings (LF or CRLF).

Usage

ctrl+alt+* on Windows/Linux, shift+cmd+* on Mac,

or Ctrl+Shift+P and run > 42-comment toggle.

Disable the original 42-comment if it is installed: both use the same shortcut.

Keybindings

Change the shortcut in Preferences -> Keyboard Shortcuts (search for 42-comment toggle), or in keybindings.json:

{ "key": "shift+cmd+*", "command": "extension.42-comment-toggle", "when": "editorTextFocus" }

Tests

npm test

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft