I want to know if it is possible to comment and uncomment text blocks in Visual Studio with a single command.
I'm used to just press Ctrl + / to toggle between comment and uncomment text blocks, because I've been using IntelliJ IDEA.
But in Visual Studio you have to press:
Ctrl + k + c to comment code, and
Ctrl + k + u to uncomment code.
Is there any way to comment / uncomment your code in Visual Studio with a single command just like in IntelliJ IDEA?
Actually yes, there is a way.
Tools -> Options... in the menuEnvironment -> Keyboard from the options listEdit.ToggleLineComment in the keyboard commands list
Here you can setup how to comment / uncomment a single or even multiple lines with a single keyboard shortcut.
You can actually follow this path Tools -> Options -> Environment -> Keyboard and change the drop-down selection on your top right to Visual Studio Code. This will allow you to use the Visual Studio Code keyboard bindings such as CTRL+/ to comment/uncomment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With