Custom key board mapping for Namespace organization in Visual StudioPosted: May 25, 2010
Visual studio has lot of key board shortcuts for making the things easier. One of the mostly used feature for which IDE doesn’t have key binding is “removing unused namespaces”. I like this feature very much as it makes the code much cleaner. Normally, to make this work we need to right click on the namespaces and navigate to “organize usings ->remove and sort”. We can create a shortcut key with custom key binding as shown below. You can choose any shortcut key as per your convenience but I personally prefer Ctrl+N,O (N-Namespace, O-Organize) as this is the easy one to remember.
To create this, go to Tools->Options->environment->keyboard. By typing “organizeusing” in “Show commands containing” we can see list of IDE commands. Just select the one which ends with “OrganizeUsings.RemoveAndSort” and press the shortcut key you want to assign.
Hope this helps.