Coding Horror

programming and human factors

Keyboard Shortcut Summary Macro

I finally had time to improve my Visual Studio .NET keyboard shortcut summary macro. Instead of writing HTML to the console*, it now creates a HTML file in your user documents folder, and navigates the IDE to the created file:

VS.NET keyboard shortcut summary macro screenshot

Download the Keyboard Shortcut Summary Macro (2kb ZIP)

The advantage of a macro, of course, is that it queries the IDE for the actual keyboard bindings. It can also be sorted and grouped however you like. Very handy for erstwhile keyboard ninjas! This macro is tested and working in both VS.NET 2003 and VS 2005. Note that the macro generates an appropriately named file in each case:

 

  • My DocumentsVisual Studio .NET 2005 Keyboard Shortcuts.htm
  • My DocumentsVisual Studio .NET 2003 Keyboard Shortcuts.htm

It's also smart enough not to re-render if the file already exists. If you want to force a re-render, delete the file.

Here's how to install and run this macro:

 

  1. go to Tools - Macros - IDE
  2. create a new Module named "KeyboardShortcuts" under "MyMacros"
  3. paste the above code into the module
  4. add a reference to the System.Data namespace*; make sure it builds with no errors
  5. close the macro IDE window
  6. go to Tools - Macros - Macro Explorer
  7. A new macro named "List" will be under "KeyboardShortcuts." Double-click it to run the macro
  8. the macro will take a moment to write the keyboard shortcuts to a HTML file, then open the HTML file in the IDE.

* in VS 2005, there are a few minor extra dependencies: you'll have to add a reference to System.Xml and also import EnvDTE80.

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