I cannot find a way to comment and uncomment multiple lines of code in Visual Studio Code.
Is it possible to comment and uncomment multiple lines in Visual Studio Co
You can see all available keybindings on the official documentation.
Here's the relevant bit for osx:
Key Command
⌘K ⌘C Add Line Comment
⌘K ⌘U Remove Line Comment
⌘/ Toggle Line Comment
⇧⌥A Toggle Block Comment
You will need to select the lines you want to comment first, then execute above shortcut, i.e. ⌘/
on osx Ctrl/
on Windows.
For my keyboard layout it's Ctrl + § for:
//
//
//
And Shift + Alt + A for:
/*
...
*/
In windows you need to press ctrl + / in mac you can do ⌘ + / to make multiple comment
// public function index()
// {
// $badgeIcon = BadgeIcon::all();
// return $this->showAll($badgeIcon);
// }
Then if you want to un-comment then select the lines again and then press ctrl + /(in windows) again ⌘ + /(in mac).
CTRL + SHIFT + A for CSS multiline
In the new version of VSCODE ( version 1.26.1)
comment
Double click the existing shortcut 'keybinding` You can assign any shortcuts you want. Hope it helps.
For me it was ctrl + ' (I am using a swedish layout for the keyboard). Hope that helps anyone.