visual studio code - how to comment multiple lines for html (each line instead whole block)
Asked Answered
S

3

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!

Silkstocking answered 9/4, 2017 at 4:56 Comment(1)
Is there any solution for this since asked?Bobbyebobbysocks
H
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

Hoseahoseia answered 10/1, 2021 at 2:21 Comment(0)
T
1

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

Tacklind answered 10/7, 2017 at 1:27 Comment(2)
This question was about Visual Studio Code, not Visual Studio.Phantasmagoria
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)Domesday
S
0

Use the keyboard shortcut:

ctrl + shift + /

Saba answered 25/5, 2022 at 9:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.