What keyboard shortcut is there to organize C# usings in Visual Studio?

C#Visual StudioVisual Studio-2013Refactoring

C# Problem Overview

Is there a way to organize C# usings (remove and sort, in separate or together) via a shortcut in Visual Studio for one or more files of a project?

I know that this can be done via the menu for one file by selecting

Edit > IntelliSense > Organize Usings > Remove and Sort

but I want to do this much faster. I am using Visual Studio 2013 Express for C# development (wondering how this can be done in older & other versions too though). Thank you in advance.

C# Solutions

Solution 1 - C#

Since VS2017, it's a builtin shortcut. Simply press Ctrl + R, Ctrl + G. Credit goes to Emanuel Ve, who mentioned this first in the comments; I'm putting the advice into an answer for greater visibility.

Solution 2 - C#

Go to Tools => Options => Environment => Keyboard

enter image description here

Enter the key combination you want to use (click the Press shortcut keys: textbox, press your key combo as you would execute it while editing)

enter image description here

Then type "usings" in the Show commands containing: textbox

enter image description here

And now you can assign whichever version of these remove/sort usings commands that you like to the key combination.

This works for pretty much every command in Visual Studio, and from any addons you have installed. Just type a word involved in the command name to find the command. Assign away!

Solution 3 - C#

In addition to @Will's answer, Productivity Power Tools is a great addon that has all this - and lots lots more!

enter image description here


All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNick LouloudakisView Question on Stackoverflow
Solution 1 - C#James KoView Answer on Stackoverflow
Solution 2 - C#user1228View Answer on Stackoverflow
Solution 3 - C#PingiView Answer on Stackoverflow