Comment toggling in VS Code

Nick Gibbon
Pareture

--

QUICK TIPS #1

The Microsoft Visual Studio Code Editor enables fast, intelligent code commenting shortcuts for many languages as a feature.

Line commenting

This shortcut saves the most time for me!

  1. Highlight the lines you wish to comment in or out.
  2. Hit the shortcut sequence.

MacOS: command + /

Windows & Linux: ctrl + /

Java

Java
Java Line Comment

Python

Python
Python Line Comment

Block commenting

  1. Highlight the lines you wish to comment in or out.
  2. Hit the shortcut sequence.

MacOS: shift + option + A

Windows: shift + alt + A

Linux: ctrl + shift + /

Java

Java Block Comment

Python

Python Block Comment

Useful Links

MacOS

https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf

Windows

https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf

Linux

https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf

VS Code Key Bindings Doc

You can edit all shortcuts.

https://code.visualstudio.com/docs/getstarted/keybindings

--

--

Pareture
Pareture

Published in Pareture

Mostly modern software engineering related to cloud infrastructure, platforms & tools.

Nick Gibbon
Nick Gibbon

Written by Nick Gibbon

Software reliability engineer & manager in cloud infrastructure, platforms & tools.

No responses yet