Tip: Vim and python indentation
Posted on November 3, 2007
Filed Under python, tips, vim |
Usually I prefer tabs indentation rather than space indentation for python code. Unfortunately often python code from open source projects or code that you can find on the net use space indentation. To convert from one to the other you can simply use a vim substitution.
Example:
:%s/ /\t/g
It’s as simple as this
This will convert a four spaced indentation with a one tab one and make we happy ![]()
Comments
One Response to “Tip: Vim and python indentation”
Leave a Reply
eeeeuuuw….i do it the other way around!
also, Style Guide for Python Code prefers spaces to tabs:
http://www.python.org/dev/peps/pep-0008/
at the end of the day, each to their own…