There are times that I have a code snippet that I want to post on a defect tracker, wiki, forum, etc. but it's deeply indented in the code. I usually have to highlight the code snippet, hit <shift>-<tab> until the indents aren't so bad, then copy/paste and then revert the code. It gets somewhat painful.
Is there a tool that can remove the tabs in front of the each line? Note that I don't want to remove all tabs from all lines, just same preceding number of tabs from each line. I'm thinking some function of Emacs could do this.
Here's an extreme example:
Before:
//This is usually some method in an anonymous inner class' anonymous inner class. @Override public void method(){ doSomething(); }
After:
//This is usually some method in an anonymous inner class' anonymous inner class. @Override public void method(){ doSomething(); }
Notice how doSomething() still has a single tab in front of it.