9

I'm using Visual Studio 2012, and I was wondering if there is any keyboard shortcut that does

the reverse effect of tab

codin freak
  • 257
  • 1
  • 2
  • 9
  • The thing is, this not only works for Visual Studio but most other text editors as well. I use it often. – Shaz Sep 19 '13 at 13:48

3 Answers3

51

if you're talking about e.g. tabbing the code to indent it, then

SHIFT + TAB

codin freak
  • 257
  • 1
  • 2
  • 9
DaveDev
  • 41,155
  • 72
  • 223
  • 385
  • You could also select some code then go to Edit > Advanced > Format Selection – Sayse Sep 19 '13 at 10:52
  • @codinfreak - I still don't understand what your question says or how dave managed to get the right answer. I'm just saying something else you could use as well as the keyboard shortcut – Sayse Sep 19 '13 at 10:54
3

DaveDev beat me to it you can use SHIFT + TAB to move code inversely to what tab would do to the code.

As an extra bit of detail about formatting, you can also use CTRL+E+D to format the entire document which may save you time, or if you have a specific selection such as a if statement highlight it and press CTRL+E+F.

Happy formatting!

Edit: to do the keyboard keys, do <.kbd>CTRL<./kbd> but remove the periods.

Ben Maxfield
  • 635
  • 7
  • 21
  • 1
    Be aware the format keys do vary depending upon the chosen VS environment settings, e.g. General developer vs C# developer, so it can be CTRL + K + D, rather than CTRL + E + D – SteveC Sep 19 '13 at 15:32
  • Yeah, it had me confused when I was thumping hard on the K D keys and nothing was happening ... finally sussed the reason :-) – SteveC Sep 19 '13 at 16:04
1

try this combo to reverse tab effect

SHIFT + TAB

codin freak
  • 257
  • 1
  • 2
  • 9
iJade
  • 23,144
  • 56
  • 154
  • 243