Menu: Tools -> Options -> Keyboard
So you want to create a new keyboard shortcut but don't know how to do it? Let's walkthrough an example to show you how! First, go to Tools -> Options -> Keyboard:
Now let's assume we want to modify the "View.ViewCode" command to include a new shortcut. Notice the existing shortcuts (assuming no additional keyboard mapping schemes):
We want to add CTRL + Z as the shortcut so click in the "Press shortcut keys" area and press CTRL + Z:
But there is a problem! Looking down at the "Shortcut currently used by" area we see that CTRL + Z is already mapped to the "Edit.Undo" command. Since that is an important key combination to us, we will try a new set of shortcut keys. How about CTRL + ALT + 4?
Sweet! It isn't being used by anything currently. BUT we aren't done yet. We have to decide WHERE we want this shortcut to be available at. The default scope is "Global" so you can use it at any time. However, you can narrow the scope down to a specific area:
For example, if I wanted to have this shortcut only available when I'm editing XML, I would change "Global" to "XML (Text) Editor". For now, we will keep it "Global":
Once we've decided on the scope and the shortcut keys all we have to do is click the Assign button to make the shortcut available:
If you mess up here, you can choose the shortcut key and click the Remove button to start over.
WARNING: You can remove just about any shortcut so be careful to only remove the shortcuts you want to be gone.
Click OK and let's go test our new shortcut. Go to any design view:
Press CTRL + ALT + 4 to see the result:
It works! Congratulations! You now know how to map new keyboard shortcuts.