Home >Development Tools >VSCode >How to comment code in vscode
Using Django’s three lines of code as an example:
1. Single-line comments: (Comment the first line of code )
1. Place the cursor before the first letter, shift #, and cancel the same.
#2. Place the cursor anywhere in the first line (either in the middle or at the end of the sentence), press ctrl /, and the same applies to cancel.
#3. Select a line of code you want to comment with the cursor, alt shift A, cancel the same.
4. Select a line of code you want to comment with the cursor:
(1) ctrl k;
(2) ctrl c .
Cancel is:
(1) ctrl k;
(2) ctrl u.
2. Multi-line comments: (comment multiple lines of code)
1. Select all the codes you want to comment with the cursor. ctrl /, cancel the same.
#2. Select all the codes you want to comment with the cursor, alt shift a, cancel the same.
3. Select all the codes you want to comment with the cursor:
(1) ctrl k;
(2) ctrl c.
Cancel is:
(1) ctrl k;
(2) ctrl u.
PHP Chinese website has a large number of free vscode introductory tutorials, everyone is welcome to learn!
The above is the detailed content of How to comment code in vscode. For more information, please follow other related articles on the PHP Chinese website!