Helixoft Blog

Peter Macej - lead developer of VSdocman - talks about Visual Studio tips and automation

Assigning a Keyboard Shortcut to a Macro in VS

Last time I forgot to mention one important thing - how to assign a keyboard shortcut to your macro. Often you don't need any button for your macro, the shortcut is enough. Or you can have both. As I already wrote, macro is similar to any named command. So to assign a shortcut to it:

  1. Go to menu Tools - Options... and select Environment - Keyboard.

    Keyboard options in Visual Studio

  2. Find your macro in the list of commands. All macro names start with "Macro.". To filter out other commands enter your macro name in the Show commands containing field. If your macro is named test as in our example then type test. Select your macro.
  3. Go to Press shortcut key(s) field and press your shortcut. If the shortcut is already in use, you will see it. Press Assign button. Remember that you cannot change or assign the shortcut if you are using predefined keyboard mapping scheme. You will be warned in this case. You must create a copy of current scheme and use that copy. Press Save As... button under Keyboard mapping scheme and give it some name. Then select this new scheme.

Comments

# srikanth 2009-10-10 14:10
yes i can read the code
# savita 2010-05-12 07:57
Great!! Its really very much time saving!!!... Thanks
# Lelala 2012-08-15 18:24
Thanks, especially helpful if you have to connect to IIS explicitly for debugging reasons - a macro for such cases is good example how you can safe time with very simple tricks.
Regards
# Smithf924 2014-09-01 01:08
Really informative blog article.Really thank you! Want more. kaggdkdeedeeefa c

Comments are now closed for this entry

 

Start generating your .NET documentation now!
DOWNLOAD
Free, fully functional trial