1. [Home](<https://delaparra-services.nl/>) 
1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) 
1. [Toggle Line Comment](<https://delaparra-services.nl/knowledge-hub/toggle-line-comment>)

  

Category: Keyboard shortcuts 

# Toggle Line Comment

  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    

## 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](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/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[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026

 

## More Keyboard shortcuts terms

 

- [Step Out](<https://delaparra-services.nl/knowledge-hub/step-out>) 
- [Step Over](<https://delaparra-services.nl/knowledge-hub/step-over>) 
- [Toggle Breakpoint](<https://delaparra-services.nl/knowledge-hub/toggle-breakpoint>) 
- [Toggle Integrated Terminal](<https://delaparra-services.nl/knowledge-hub/toggle-integrated-terminal>) 
- [Toggle Sidebar](<https://delaparra-services.nl/knowledge-hub/toggle-sidebar>) 
- [yy (yank line)](<https://delaparra-services.nl/knowledge-hub/yy-yank-line>)

 

[All terms starting with T](<https://delaparra-services.nl/knowledge-hub#letter-t>)

 

## Skills

 

- ### Editor shortcuts (VS Code / Cursor and Vim)

 

Use when a user asks how to do something faster in VS Code (or Cursor) or Vim, asks what a keyboard shortcut does (e.g. Ctrl+D, Ctrl+Shift+P, F12, gg, dd, yy, ciw, :wq), wants to customise keybindings, or is stuck in Vim. Gives the correct shortcut for their operating system and can write keybindings.json entries.

 [View skill](<https://delaparra-services.nl/skills/editor-shortcuts>) [Download zip](<https://delaparra-services.nl/skills/editor-shortcuts/download>)

 

## Manuals

 

- [Keyboard shortcuts in VS Code and the terminal](<https://delaparra-services.nl/manuals/sneltoetsen-in-vs-code>) 
- [Installing Visual Studio Code](<https://delaparra-services.nl/manuals/visual-studio-code-installeren>)

 

## 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.

  [Get in touch](<https://delaparra-services.nl/availability>)

[HTML version](https://delaparra-services.nl/knowledge-hub/toggle-line-comment)
