9

When I comment HTML files, VSCode wraps my selection and puts a single <!-- --> tag around the whole selection.

How can I change it so that instead it comments every single line individually? (like e.g. in WebStorm)

Thanks!

1
  • Is there any solution for this since asked? Commented Jun 16, 2017 at 13:16

3 Answers 3

4

I made an extension that will do what you want: Toggle Comments.

Using this keybinding:

  {
    "key": "ctrl+alt+/",               // whatevefr keybinding you wish
    "command": "toggle-comments.toggleLineComments",
    "when": "editorTextFocus"
  }

html comment each line separately demo

Sign up to request clarification or add additional context in comments.

Comments

1

Keyboard shortcut to comment multiple in Windows is 'Shift+Alt+A'.

2 Comments

This question was about Visual Studio Code, not Visual Studio.
This works with Shift + Option + A in Mac but not for each line. It is just as Cmd + / so I think this is not an answer (still no available answer after two years)
0

Use the keyboard shortcut:

ctrl + shift + /

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.