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.
The solution is simple, select both lines, and hit Ctrl + K + C, and voila, both lines are commented!
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