views:

45

answers:

3

I know that the general tabs vs spaces thing is as old as the hills and mostly comes down to personal preference/sticking to the style of your team, I just wanted to ask a practical question about using spaces in Visual Studio. There are certain things about tabs that bug me and I wouldn't mind changing to spaces while we're a small team. It would be no different for writing the code in the first place but would mean you'd have to delete/backspace 4 times where I'd previously press it once.

Is there any easy way of deleting tab sized amounts of spaces easily (other than dragging with the mouse etc.) or if you've gone through the changeover yourself is it something that eventually doesn't bother you at all?

+1  A: 

Yes, there's a very easy way.
You set your Visual Studio options (Tools/Options/Text Editor) to use spaces instead of tabs and then you open a source file and Ctrl-E,D (Edit/Advanced/Format Document) and it will convert them all for you!

Yay for automation!

Task
This is a neat trick; unfortunately it also takes care of all the "other" formatting as well ;-)
pst
"other" formatting? I can't currently think of more than one kind of formatting...
Task
+2  A: 

In Visual Studio, use Shift-Tab. This will go back one tab-stop, even when using soft tabs.

Forgotten Semicolon
Excellent, I actually use this quite a lot already to change blocks of code, didn't actually know or think about what it did when there's nothing selected.
identitycrisisuk
A: 

I don't think there is an easy answer to this problem. I use Xcode and Visual Studio, and both have really annoying indentation. Maybe there's an option to disable autoindentation altogether.

mcandre