What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 133 Stack Exchange communities.

Possible Duplicate:
Add increase/decrease tab indent buttons to the editor toolbar

Visual Studio has a feature that does exactly what i'm talking about if anyone is confused:

enter image description here

Basically it allows you to select several lines of text and either add or remove tabs. This would make formatting code on StackOverflow much easier. I will often copy code from my IDE that is 5 or 6 tabs deep and when I paste it into my question it keeps all those tabs, so it ends up like this:

                            Console.WriteLine("Hello world!");
                            Console.WriteLine("Hello world!");
                            Console.WriteLine("Hello world!");
                            Console.WriteLine("Hello world!");
                            Console.WriteLine("Hello world!");

It would be nice if I could just select those lines and remove unneeded tabs.

share|improve this question

marked as duplicate by Won't Mar 14 '11 at 20:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Been there, asked that. –  Won't Mar 14 '11 at 20:43

1 Answer 1

up vote 6 down vote accepted

There is a rough remove tabs functionality. I just tested it now. Starting with this:

                            Console.WriteLine("Hello world!");
                            Console.WriteLine("Hello world!");
                            Console.WriteLine("Hello world!");
                            Console.WriteLine("Hello world!");
                            Console.WriteLine("Hello world!");

I highlight it all, then hit nothing but the Code Formatting button 7 times, and...

Console.WriteLine("Hello world!");
Console.WriteLine("Hello world!");
Console.WriteLine("Hello world!");
Console.WriteLine("Hello world!");
Console.WriteLine("Hello world!");

It will only go in one direction until it hits the end, though that should be sufficient to most purposes. Doing this to your whole code block should keep everything in their proper alignment for your post.

There currently isn't any sort of built-in method to add tabs more than one deep.

share|improve this answer
    
Try the quote:code:quote:code pattern and see how that goes for you –  random Mar 14 '11 at 19:28
1  
@random It ends up very... Space Invaders. –  Grace Note Mar 14 '11 at 19:29
    
Ahh, very cool. Didn't realize you could do that. –  Abe Miessler Mar 14 '11 at 20:07

Not the answer you're looking for? Browse other questions tagged .