How does one set Visual Studio 2010 keyboard short

2020-03-26 07:09发布

问题:

In every Visual Studio.NET version you can set keyboard shortcuts using menu Tools -> Options -> Environment -> Keyboard and then find the command you want to assign a shortcut to by entering part of it in "Show commands containing".

For one thing, the listbox is ridiculously short and hard to navigate - is there an alternative?

Then, how do I find out the correct command name for a specific action?

Specifically, I'm using ReSharper 5.1 with Visual Studio 2010 and want to have the Alt + Enter shortcut back (it used to be there in older versions by default) that opens the ReSharper context menu when the cursor is over a curly underline ReSharper uses to highlight errors or warnings.

How do I find out the command name for that (except by an educated guess)?

回答1:

The way I do this is to perform an action while recording a macro (using Tools / Macro / Record temporary macro).

When I have finished with the action, I look at the source code of the macro and it usually helps to find the correct command.

For example, I have just let R# add some magic through Alt-Enter, and the macro recorder has:

DTE.ExecuteCommand("ReSharper_QuickFix")


回答2:

You can rebind all of the ReSharper shortcuts by using the ReSharper -> Options -> Visual Studio Integration page. Select a keyboard scheme and hit "Apply Scheme".