Adrian Alonso

"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. 

Posted: Aug 15 2007, 10:56 PM by adalon | with 5 comment(s)
Filed under: , ,

Comments

mike said:

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

Thanks

# October 27, 2007 12:06 AM

adalon said:

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

# October 27, 2007 7:25 AM

mike said:

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

# October 28, 2007 10:58 PM

Jd said:

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.

# February 29, 2008 9:55 AM

bkar81 said:

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

# July 13, 2009 2:24 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)