Since these days I practically live inside Visual Studio (and e editor at night for RoR), here is a small list of shortcuts for Visual Studio. These shortcuts will vary depend on your coding environment, but so far these I have tested to work for VB# environment in VS2005. Enjoy!
“CTRL + K” chorded shortcuts
(Just hold CTRL down and type “K” then “N” for example)
- CTRL + K, C: comment out the selected lines
- CTRL + K, U: un-comment out the selected lines.
- CTRL + K, K: new bookmark
- CTRL + K, N: jump to next bookmark
- CTRL + K, P: jump to previous bookmark
- CTRL + K, F: format the selected lines
- CTRL + K, I: show summary for the current token (e.g. variable type, Class summary, etc.)
Code Manipulations
- CTRL + Shift + Space: show signature/ parameters info for the current function. Use Up/Down arrow key to go through list as usual
- CTRL + Space: show Intellisent Popup.
- CTRL + L: cut the current line
- CTRL + Shift + L: delete the current line
- CTRL + U: convert to lower case
- CTRL + Shift + U: convert to uppercase
- I can’t resist to include the highly addictive chorded shortcut CTRL + K + C/U for quickly commenting/ uncommenting code block
- CTRL + Shift + F: Find for multiple files
- CTRL + Shift + H: Find & Replace for multiple files
- CTRL + F: find in current document.
- F3: find next
- Shift + F3: find previous
- CTRL + K, I: show summary for the current token (e.g. variable type, Class summary, etc.)
Code Maneuvering
- F12: go to definition
- Shift + F12: go to declaration
- CTRL + - (hyphen): jump to previous position
- CTRL + Shift + - (hyphen): jump to next
- CTRL + G: go to line #
Regions/ code blocks
- CTRL + M, O: Collapse all region blocks
- CTRL + M, M: toggle current block (such as collapsing/ expanding a method block)
- CTRL + M, P: toggle comment block (?)
- CTRL + M, L: Expand/ Collapse All
Build-Debug
- CTRL + Shift + B : build solution
- CTRL + F5: Run without Debugging
- Shift + F5: Break Debugging (VS2005 default key combination for this is changed, but you can reassign back to the “conventional” VS2003 way. Or use Shift + Break - the new combination)
- F9: set breakpoint
- CTRL + Shift + F9: clear all breakpoints
- CTRL + ALT + V, L: Open Locals Window (Debug)
- CTRL + ALT + V, A: Open Autos Window (Debug)
- CTRL + ALT + C: Open Call stack Window (Debug)
- Ctrol + Alt + W, [1,2,3,4]: Open Watch windows (Debug)
Miscellaneous
- CTRL + Tab: switch between opening files. Hold
- CTRL + PAGE UP/ DOWN: tab between available “view” of the currently opened document (e.g. Design view, Source View, etc.)
- CTRL + W: select the word under the current caret position. (Watch out for this since in both IE and FF, CTRL W will close the current tab.)
- ALT + Mouse Drag: Retangular block selection (e editor also has this feature and make it even better)
- CTRL + I, then type the search word, then F3: incremental search (a.k.a. search-in-place)
Important Windows
- CTRL + ALT + L: Solution Explorer
- CTRL + ALT + K: Task List
- CTRL + ALT + O: Output
- CTRL + Shift + C: Class View
- CTRL + ALT + V, L: Locals (Debug)
- CTRL + ALT + V, A: Autos (Debug)
- CTRL + ALT + C: Call stack (Debug)
- CTRL + ALT + W, [1,2,3,4]: Watch windows (Debug)
- CTRL + ALT + V, [1,2]: Find Results windows
Productivity Enhancements
- Any comments with TODO keyword can be listed in the Task List window. (You may have to switch to “Comments” instead of User Tasks) [now I’m pretty excited since both RoR’s “rake notes” and VS2005’s Task List both use the same TODO format — one less thing to remember!]
Links
This list is compiled by myself, but here are some other useful links for Visual Studio shortcuts: