Remove a keyboard shortcut binding in Visual Studio using Macros

Posted by Pete on Stack Overflow See other posts from Stack Overflow or by Pete
Published on 2010-02-24T08:25:24Z Indexed on 2010/04/20 6:43 UTC
Read the original article Hit count: 394

Filed under:
|

Hi.

I have a lot of custom keyboard shortcuts set up. To avoid having to set them up every time I install a new visual studio (happens quite a lot currectly, with VS2010 being in beta/RC) I have created a macro, that sets up all my custom commands, like this:

DTE.Commands.Item("ReSharper.ReSharper_UnitTest_RunSolution").Bindings = "Global::Ctrl+T, Ctrl+A"

My main problem is that Ctrl+T is set up to map to the transpose char command by default. So I want to remove that default value in my macro.

I have tried the following two lines, but both throw an exception

DTE.Commands.Item("Edit.CharTranspose").Bindings = ""
DTE.Commands.Item("Edit.CharTranspose").Bindings = Nothing

Although they kind of work, because they actually remove the binding ;) But I would prefer the solution that doesn't throw an exception.

How is that done?

© Stack Overflow or respective owner

Related posts about visual-studio

Related posts about envdte