22

I am using VS 2010 and there is one shortcut I really like which is a shortcut I set myself: ctrl + shift + Q in order to remove all unused usings and sort the remaining ones. I installed ReSharper and it overwrote my VS shortcuts, so pressing ctrl + shift + Q will generate a comment (/**/).

Is there any way I can disable this single shortcut? (or change it to any other key combination that will allow me to use my old one?

I tried this solution: How to change shortcut keys for a given command in ReSharper? but my shortcut is still set in my VS configs.

2
  • When you go into Tools | Options | Environment | Keyboard, and click in Press shortcut keys, and press Ctrl+Shift+Q, what appears in Shortcut currently used by ? Commented Oct 19, 2012 at 8:29
  • @AakashM Edit.RemoveAndSort which is the expected behavior... Commented Oct 19, 2012 at 17:27

2 Answers 2

39
  1. Go to Tools > Options > Environment > Keyboard
  2. Search for a command called ReSharper.ReSharper_BlockComment
  3. Remove the current shortcut or reassign another shortcut to the ReSharper command.

I'm guessing that you've set your shortcut in Global context whereas ReSharper has assigned the shortcut to its command in the Text Editor context. The latter takes precedence when you're invoking the shortcut while editing your code.

Also, consider taking a look at ReSharper's own Code Cleanup, which takes care of unused directives, other redundant items, and formatting.

Sign up to request clarification or add additional context in comments.

2 Comments

This defintely does not work in VS 2019. Resharper won't release the shortcut key.
Sorry, I don't have VS 2019 installed to see what's going on there.
3

To elaborate on the steps:

Suppose you want to change the binding of "Ctrl +Q"

  1. Open Tools Options Environment Keyboard

  2. Under "Press Shortcut Keys" Enter : Ctrl +Q

  3. This will show you what all commands are currently bound to this shortcut

  4. Then search for the commands in the "Show Commands containg window " and REMOVE the assignment (for the context that you want).

  5. Note that more than 1 command can bind to a shortcut depending on the context and so make sure you remove whatever you need

  6. Then verify that no the binding is gone, by repeating step 2 above

  7. Finally search for the new command that you want to bind the shortcut to and then enter shortcut and bind it in the context that you want to using ASSIGN

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.