DELAPARRA
Index
Color
NL
Category: Keyboard shortcuts

Toggle Line Comment

Explained by Updated

What is Toggle Line Comment?

Toggle Line Comment: Comment or uncomment the current line (or selection). Works in any language. Toggle Line Comment comments out the current line or selected lines, or uncomments them if they already are. In VS Code and JetBrains IDEs it is Ctrl+/ or Cmd+/. The editor uses the right comment style for the language: // in PHP and JavaScript, # in Python and YAML, <!-- --> in HTML. Block comments have their own shortcut, Shift+Alt+A in VS Code.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about Toggle Line Comment

What should you keep in mind with Toggle Line Comment?

It is handy for temporarily disabling code while debugging. Do not leave large blocks of commented-out code in the codebase, though. Version control already remembers old code, and commented blocks confuse later readers, who cannot tell whether the code is still needed. Delete it, and fetch it from Git history if you ever need it again.

At a glance

CategoryKeyboard shortcuts
Explained by
Updated

More Keyboard shortcuts terms

All terms starting with T

Skills

Manuals

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.