Back to some basics today. These are probably my favorite Visual Studio keyboard shortcuts:
CTRL-K,C – comment selection
CTRL-K,U – uncomment selection
To invoke either command, hold down the Control key while hitting K and then either C or U. These two are way up on my list because the ability to easily comment large sections of code makes me less likely to delete them when I feel they’re not necessary. 90% of the time I end up deleting the commented code anyway, but it’s nice to have for that other 10%.
There are many more shortcuts that are accessed using CTRL-K plus an additional key. Here’s a pretty comprehensive list of all the shortcuts in Visual Studio 2003 and 2005.
2007 October 25 at 7:57 pm
This also works in config files — inserts leading around the selected block