Did you know… How to bind keyboard shortcuts to commands

 

The Visual Studio shell is a big place.  I should know, since I used Visual J++ everyday for a year before joining the team.  As I write these tips, I try to think back to my J++ days to come up with a list of tips and tricks I wish I had known back then what I now take for granted.  One of these is definitely keyboard binding.  Maybe I didn’t look hard enough for features within Visual Studio.  Maybe I never needed to rebind a command, so I never discovered this.  Anyways, here’s how to do it, so everyone knows now.

  1. Go to Tools – Options and choose Environment – Keyboard

  2. Either select the command from the list or type in the command name in the edit box above it

  3. In the “Press shortcut key(s)”, press the keyboard shortcut you want to associate with the currently selected command

  4. Press Assign

If there’s a conflict, the “Shortcut currently used by:”  will show the conflict.  Pressing Assign will override the conflict.

Also note that there are different scopes.  There’s the combo box “Use new shortcut in:” which usually says “Global.”  This is the current scope for that particular keyboard shortcut.  For example, keyboard shortcuts assigned in the “Text Editor” scope will only work when focus is on the Text Editor.  If you place focus on a tool window and try the same keyboard shortcut, the command that is bound to that keyboard shortcut under global scope will execute.

Another “fun” way of learning about Visual Studio is to go through the list of commands available.  For example, if you type Edit.Line, you’ll see all of the commands that contain “Edit.Line”.  You’ll discover a command called “Edit.LineTranspose” which is bound to Shift+Alt+T.  In case you ever need to transpose a line, you now know the keyboard shortcut for it.

And vice versa, if you want to find out what the commands that are bound to Ctrl-<letter>, simply put the focus into the “Press shortcut key(s):” edit box and party on it ‘til your heart's content. 

Happy Editing!

http://blogs.msdn.com/saraford/archive/2004/11/15/405701.aspx

 

 

 

Visual Studio

 

Photoshop
3ds Max
 

Amirbahador Institute, © Copyright, May, 2006, All Rights Reserved