Visual Studio Code keyboard shortcut to manage your code

I’m a big fan of keyboard shortcuts (I’m giving away my age), and back in the day, knowing these helpful keyboard shortcuts to manage your code would get you ahead of the pack. Visual Studio Code is a keyboard shortcut paradise, and I’ve just found this one working in a simple code. Sometimes you need to comment out an entire block. In my example, I want to comment the lines 4 and 5.

Visual Studio Code keyboard shortcut

The solution is simple, select both lines, and hit Ctrl + K + C, and voila, both lines are commented!

Visual Studio Code keyboard shortcut

If you want to remove the comments, select the same lines, and hit Ctrl + K + U, and it goes back to normal!

I wish I knew about this Visual Studio Code keyboard shortcut when I had an entire code in ARM that I had to comment out in the past.

Featured image: Shutterstock

Leave a Comment

Your email address will not be published.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top