How can I make CTRL + / toggle a comment in Visual Studio, as it does with XCode and Eclipse?
You can't make it toggle without going into either a macro or other VS extension.
However, I always setup VS to comment with Ctrl + / and uncomment to Ctrl + Shift + /
You can customize the keyboard shortcuts by going int the "Tools" menu and selecting "Options". Then select "Keyboard" from the "Environment" branch. From there you can bind the
If you have ReSharper installed (and using VS without it is/was tedious), you can assign a single key to the command
For instance, I bind the keyboard shortcut
Ctrl-K and Ctrl-C will comment one or more selected lines.
Ctrl-K and Ctrl-U will uncomment one or more selected lines.
You can get toolbar icons that will do this by adding the "Text Editor" toolbar. In the toolbar area right-click and select "Text Editor" This will add a strip of icon buttons like this:
You can customize this strip by selecting the dropdown at the end of the ribbon:
To edit the keyboard combination go to Tools-Options and select Keyboard under the Environment tree. Here you can change the keys used to trigger the Comment and Uncomment actions: