Here is an easy way to comment or uncomment multiple lines in the vscode editor using keyboard shortcuts.
To Comment Multiple lines using the shortcut:
To comment line(s)
Ctrl + /
To Un-Comment multiple lines of code:
- Select the area of code that is commented already
- Press Ctrl+ / – (Control key and forward slash)
The best feature is the vscode automatically prepends or deletes the comment characters according to the language of the page, such as comments by double forward slashes, hash (or pound) etc.
Conclusion
This how-to guide explains the comment shortcut visual studio. Please also refer to another superfast shortcut to select code block in vertical: Vscode vertical select