"Organize Usings" in VS code name "Orcas" ala Eclipse

This post was originally published at http://adrianalonso.blogspot.com

 

Those that have used Eclipse will probably miss the ctrl+shift+o shortcut ("Organize Imports") when you switch to VS. But now VS code name "Orcas" provides a "new" feature (which unofficially existed in Whidbey) that allows you to remove and sort usings:

So if you don't want miss the Eclipse feature anymore you can add the shortcut going to Tools->Options->Environment->Keyboard

Search the RemoveAndSort command and press the ctrl+shift+o combination. Note that the shorcut is currently used by the OpenProject command and it will lost if you confirm to use the combination for the RemoveAndSort command. 

5 Comments

  • I have followed the instruction but it does not take effect at all. Could you please tell me why?

    Thanks

  • Hi Mike, are you using Orcas Beta 2. It's a VS built-in feature. You can assign a key combination a any VS command. Please check if the combination is being saved and then try it in an opnened C# file over the editor surface.

    Thanks!
    Adrian

  • I am using VS 2005 and don't notice of what Orcas Beta 2 is actually. I just thought the feature of organizing usings is built-in one of VS2005 :-

    Thanks

    mike

  • Not quite as good as the Eclipse "Organize Imports" - which really sucks because that's a feature I really miss from Eclipse.

    When I say not "quite" as good, it's because in Eclipse, I could, say, in code do something like:

    ArrayList list = new ArrayList();

    and then ctrl-shift-o to automatically import the proper package.

    The VS version still requires you to specify the import - it really only helps in removing unused imports.

  • For VS2005, it is not working. It is saying that the feature is not currently available

Comments have been disabled for this content.