Reputation: 1
I try to comment a line in internal CSS in HTML file (in style element) using Ctrl + /
but VSCode comment the line like html (using <!-- -->
)
like this
I know I should use /* */
but I want to know how can I comment a line in internal CSS using VSCode shortcut?
Note: I use Version: 1.60.2 (user setup) and these are my extensions.
Upvotes: -1
Views: 12486
Reputation: 1
Settings > keyboard shortcuts > Emmet Toggle Comment
It will be set to the default source Add a key binding to it, and it will work.
Upvotes: 0
Reputation: 1
The default shortcut in Windows is Ctrl+#.
Alternatively, you can search for "Toggle comment" under File -> Preferences -> Keyboard Shortcuts and enter the desired key combination.
Upvotes: 0
Reputation: 31
Try this in vs code:
Settings > keyboard shortcuts > Emmet Toggle Comment
It will be set to the default source Add a key binding to it, and it will work.
Upvotes: 3
Reputation: 2277
The alternative shortcut to comment code is Ctrl+K, Ctrl+C, and for uncommenting it's Ctrl+K, Ctrl+U.
For some languages, CSS for example, Ctrl+K, Ctrl+C work as toggle for both states.
Upvotes: 5