I have some Python code that have inconsistent indentation. There is a lot of mixture of tabs and spaces to make the matter even worse, and even space indentation is not pre
I have a simple solution for this problem. You can first type ":retab" and then ":retab!", then everything would be fine
There is also PythonTidy (since you said you like HTML Tidy).
It can do a lot more than just clean up tabs though. If you like that type of thing, it's worth a look.
In case of trying to find tool to make your 2-space indented
python script to a tab indented
version, just use this online tool:
https://www.tutorialspoint.com/online_python_formatter.htm
Try Emacs. It has good support for indentation needed in Python. Please check this link http://python.about.com/b/2007/09/24/emacs-tips-for-python-programmers.htm
If you're lazy (like me), you can also download a trial version of Wingware Python IDE, which has an auto-fix tool for messed up indentation. It works pretty well. http://www.wingware.com/
Using Vim, it shouldn't be more involved than hitting Esc, and then typing...
:%s/\t/ /g
...on the file you want to change. That will convert all tabs to four spaces. If you have inconsistent spacing as well, then that will be more difficult.