Shortcut
Visual Studio Code Toggle Line Comment Shortcut
The Visual Studio Code shortcut to toggle line comment is Ctrl + / on Windows. On Mac, press Cmd + /.
Quick Answer
- Windows
- Ctrl+/
- Mac
- Cmd+/
- Web
- Not confirmed yet
Visual Studio CodeShortcut
Toggle Line Comment
Comments or uncomments the current line.
How to toggle line comment in Visual Studio Code
- Open Visual Studio Code and go to where you want to toggle line comment.
- Press Ctrl + / on Windows or Cmd + / on Mac.
Visual Studio Code Toggle Line Comment Shortcut for Windows
Press Ctrl + /.
Visual Studio Code Toggle Line Comment Shortcut for Mac
Press Cmd + /.
Visual Studio Code Toggle Line Comment Shortcut for Visual Studio Code Web
We haven't confirmed a Visual Studio Code Web shortcut for this yet.
Related Keyboard Shortcuts
Frequently asked questions
What is the Visual Studio Code toggle line comment shortcut?
On Windows, press Ctrl + /. On a Mac, press Cmd + /.
Is there a Mac shortcut to toggle line comment in Visual Studio Code?
Yes: Cmd + /.
Does it work in Visual Studio Code for the web?
We haven't confirmed a web version shortcut for this yet.
Official source · How we verify