Changing Visual Studio Shortcuts
OK, so I’ve been playing with VS2008 for a few days now, and I had a minor annoyance. At first, I was inclined to blame the designers, but it turns out it was my own fault, or rather, my own lack of knowledge.
My complaint was that in VS2005, “F6” is the Shortcut Key for “Build Solution”, but in VS2008 it had been returned to “Ctrl+Shift+B” (like VS2003). At first, I was upset by this, but I did a little digging and was chagrined to find that my VS2005 Keyboard Settings had been changed from “Default” to “Visual C# 2005”. I checked in VS2008, and sure enough when I changed the Mapping Scheme to “Visual C# 2005”, my beloved F6 had been restored. There are several options here (none of which is C# 2008).
In the process, I also found that you can set these Shortcuts yourself. If you do not want to switch, but instead wish to customize the Default settings (which can always be restored later), follow these steps:
- Go to Tools -> Options -> Keyboard.
- In “Show Commands Containing”, type “Window.NextSplitPane” (this is what F6 points to now – I found this out by first by skipping all the other steps and going directly to #8 below).
- The Current Shortcut “F6” for “Window.NextSplitPane” will be shown in the “Shortcuts for Selected Command Box”.
- Press the “Remove” button.
- Go back to the “Show Commands Containing” and type “Build Solution”.
- The Current Shortcut “Ctrl+Shift+B” for “Build.BuildSolution” will be shown in the “Shortcuts for Selected Command Box”.
- You do NOT need to Remove this, but you can if you wish. To do so, press the “Remove” button again.
- Put your cursor in the “Press shortcutkeys” textbox and press the “F6” function key.
- Press the “Assign” button.
- Press the “OK” button to save your changes.
Changes to the Keyboard Mapping Scheme should show immediately in the IDE. You can have multiple shortcuts for a given function, but naturally a shortcut can only be assigned once.
Now, obviously, I had changed the Keyboard Mapping Scheme in VS2005, I just don’t remember doing it. Visual Studio is just such an incredible tool with so many options: I’ll bet that most of us don’t know the half of it. And something like this you may do once, to tweak your setup, and then never think about again. At any rate, I hope this helps someone out there.