views:

968

answers:

4

I'm using VisualStudio 2008 for doing work in C# and JavaScript (AJAXy stuff).

Here's my issue -- I love Eclipse and especially the code formatted (Ctrl-Shift-F). Visual Studio's Ctrl-k, Ctrl-d, really sucks in comparison, especially for javascript.

Is there a way to get VS to behave like the IDE that I miss?

TIA, g

+1  A: 

go to options > environment > keyboard, find the command Edit.FormatDocument and bind that to ctrl + shift + f

EDIT: Misread, you can configure how VS formats in options > text editor > (document type).

don't know if you can get it exactly as how eclipse does, but that's where you set your preferences.

Darren Kopp
He is not missing ctrl+shift+k, He is missing the behavior.
nils_gate
oh.... ok. i see now.
Darren Kopp
A: 

I use the great Resharper plugin to format my C# code. Lots of settings to change to format your code to your liking. Can even make one coding standard with Resharper to be used by all your programmers.

As for key bindings, can change those in your options.

Carra
i have r# and i find it's formatting to be a bit to overzealous and wish it was more configurable so that i could tell it not to format certain things. still enjoy r# as a whole though.
Darren Kopp
Thanks, guys.I looked at the standard doc formatting and it has very few options. I downloaded resharper and I'm going to check it out!
Looks like promotion, didn't ask how resharper can do it, asked how studio can do it. Why not just then suggest him to buy new ide.
mamu
That's fine if you're happy with the default VS options. If you're not happy then Resharper offers a lot more formatting options. No need to buy a new ide.
Carra
A: 

I have not tried but Resharper has lot of formatting and coding related nice stuff. May be you can find something useful there, and you may start loving VS as well.

Note: Resharper on VS2005 was kind of sluggish.

nils_gate
+5  A: 

Go into Tools | Options | Text Editor and edit the language specific settings to you're liking. Ctrl-K, Ctrl-D honors these settings, so you can make the code formatter working the way you want. There are a ton of options you can change (bracket positioning, spacing, indenting, etc.).

John Sheehan