Visual Studio Code has the possibility to comment and uncomment the single line code and multiple lines. I want to share two shortcuts to do it in the Windows OS. Both hotkeys work for single and multiple lines.
CTRL + / HotKey to Comment and Uncomment Lines
An example in the HTML(Angular project) file(line 355):
An example in the ts(Angular Typescript) file(line 31):
Shift + Alt + A Longer HotKey to Comment and Uncomment Lines
An example in the HTML(Angular project) file:
In the Html file, it wraps lines by the <!– –>
An example in the ts(TypeScript Angular) file:
In the ts file, it wraps lines by the /* */
Note: if you press Shift + Alt + A or CTRL + / without lines selection VS Code will add an empty comment tag <!– –> or /* */depending on the file extension.
For MAC OS: Shift + Option + A
How to remap/change these shortcuts?
Windows: File > Preferences > Keyboard Shortcuts.
VS Code version: 1.72.2