Sunday, February 8, 2009

Useful Visual Studio 2008 keyboard shortcuts

Guys, Do you regularly or occasionally use keyboard shortcuts while writing programs esp. when formatting, invoking menu options, invoking different windows and explorers in Visual Studio.

If you say yes, then I can say definitely you're a productive guy. If you rarely use keyboard shortcuts, then I can say your productivity suffers!! Time to wake up !!

Reduce your dependency on mouse. Get your hold on keyboard. You'll then definitely realize your increase in productivity and shows off your expertise with your co-workers.

Visual Studio environment offers many powerful features and options aimed to improve developer's productivity. I'll share few ubiquitous,important and quite unknown shortcuts/commands with you in this post.

Debug/Build commands:


  1. Build operation : Shift+Ctrl+B or F6
  2. Selective Build of any single project in the solution : Shift + F6
  3. Quick Watch window: Ctrl + D, Q
  4. Immediate Window: Ctrl + D, I
  5. Autos Window: Ctrl + D, A
  6. Callstack Window: Ctrl + D, C
  7. Start with Debugging: F5
  8. Start with out Debugging: Ctrl + F5
  9. Toggle Breakpoint: F9
  10. Enable/Disable Breakpoint: Ctrl+F9
  11. Debugging: Step into : F11
  12. Debugging: Step over : F10
  13. Debugging: Step out: Shift + F11

Visual Studio Window commands:

  1. ErrorList Window: Ctrl + W,E
  2. Output Window: Ctrl + W, O
  3. Solution Explorer Window: Ctrl + W, S
  4. Toolbox Window: Ctrl + W, X
  5. Command Window: Ctrl + W, A
  6. Code Definition Window: Ctrl + W, D or F12
  7. Server Explorer Window: Ctrl + W, L
  8. Properties Windows : F4 or Ctrl + W, P
  9. To close current active window in Visual studio: SHIFT + ESC
  10. To close current active tab in Visual Studio: Ctrl + F4
  11. To move between tabs/document windows in Visual Studio : Ctrl + TAB

Navigation shortcuts:

  1. GoTo a specific line number: Ctrl + G
  2. Find something among lines : Ctrl + F
  3. GoTo next matching item or next item in the search results: F8
  4. GoTo matching opening or closing brace in a large method: Ctrl + ]
  5. Navigate backward to previously browsed line of code: Ctrl + MINUS (-)
  6. Navigate forward to next browsed line of code: Ctrl + Shift + MINUS (-)
  7. Navigate to dropdown located at top of code editor : Ctrl + F2

Editing:


  1. Replace command: Ctrl + H
  2. Comments selected lines of code: Ctrl + K, C
  3. Uncomments selected lines of code: Ctrl + K, U
  4. Formats selected lines of code : Ctrl + K , F
  5. Formats entire code document: Ctrl + K, D
  6. Replace in files : Ctrl + Shift + H
  7. Insert snippet: Ctrl + K, X
  8. Quick Info about piece of code : Ctrl + K, I
  9. Parameter info of specific method: Ctrl + K, P
  10. List members of specific object: Ctrl + K, L
Hope this post might help in saving your time and improving productivity levels.