3

I usually try to clean my code of unused using and the reason could be answered by this post.

Whenever I want to do it, I have to use my mouse and it could be a bit annoying so that's the reason why I thought in a shortcut in order achieve it. e.g:

enter image description here

And that's the result.

enter image description here

I couldn't find anything related that seems helpful.

halfer
  • 19,824
  • 17
  • 99
  • 186
Mauro Bilotti
  • 5,628
  • 4
  • 44
  • 65
  • 1
    ReSharper has such a short-cut, `Alt-Enter`, amazing to the point that you use it in other applications and wonder why it doesn't work, then lambaste them for not implementing it. – Adam Houldsworth Jul 23 '15 at 14:17

2 Answers2

7

On the Tools menu, select Options, open the Environment folder, and choose Keyboard.

On the Keyboard page select a Keyboard mapping scheme.

In the Show commands containing text box, type Edit.RemoveUnusedUsings

In the scrolling list box, select the command you want the shortcut to execute. On the Use new shortcut in drop-down list, select the environment in which you want to use the shortcut. Choose Global if you want the shortcut to work in all contexts.

Place your cursor in the Press shortcut key(s) text box and then press and hold a non-text key or combination of non-text keys (Alt, Ctrl, or Shift, for example) and type the text key of your choice. Choose Assign.

source

3

Tools > Option, navigate to Keyboard tab. Search for "Edit.RemoveAndSort" which command will to both remove unused usings and sort the usings, then set your shortcut

Striter Alfa
  • 1,577
  • 1
  • 14
  • 31