Coding Horror

programming and human factors

Visual Studio .NET 2003 and 2005 Keyboard Shortcuts

I've been trying to improve my use of keyboard shortcuts in Visual Studio .NET. Here are the ones I use most often, what I consider my "core" keyboard shortcuts:

Go to declaration

F12

Debug: step over

F10

Debug: run to cursor

ctrl + F10

Debug: step into

F11

Debug: step out

shift + F11

Toggle a breakpoint

F9

Go to next item in task list or search results

F8

Go to previous item in task list or search results

shift + F8

Switch to code view

F7

Switch to designer view

shift + F7

Run with debugging

F5

Stop debugging

shift + F5

Run without debugging

ctrl + F5

Move to previous edit point (back)

ctrl + -

Switch to the Task List

ctrl + alt + K

Switch to the Immediate window

ctrl + alt + I

Switch to the Output window

ctrl + alt + O

Find

ctrl + F

Find in all files

ctrl + shift + F

Replace

ctrl + H

Incremental find (it's pure sex!)

ctrl + I

I'm still struggling to find a keyboard shortcut that sets the input focus back to the code window after doing a ctrl+alt+O or ctrl+alt+K. As it turns out, that key is

Esc

But enough about me. Which keyboard shortcuts do you use most often?

The best early reference for keyboard shortcuts in VS.NET 2003 was Mastering Visual Studio .NET; Appendix C contains an excellent reference table of all the keyboard shortcuts in .NET.

As good as that reference table is, you can generate a better keyboard reference yourself using my improved keyboard shortcut enumerator macro.*

vs_net_keyboard_macro_screenshot.png

It groups the results by scope and sorts by primary keyboard key so related key accelerators are all displayed together (eg, F5, ctrl+F5, shift+F5, etc).

The macro works in VS.NET 2003 and VS 2005, and unless you are a total Visual Studio Ninjatm I guarantee you'll find at least a few keyboard shortcuts in there that you didn't know about. I also did a diff on the resulting files to see what keyboard shortcuts have changed in Visual Studio 2005:

* Originally based on an earlier macro I discovered.

Written by Jeff Atwood

Indoor enthusiast. Co-founder of Stack Exchange and Discourse. Disclaimer: I have no idea what I'm talking about. Find me here: http://twitter.com/codinghorror