July 9, 2013
HOWTO Enter Spaces instead of Tabs in VI & VIM
Avoid Python indentation errors by configuring VI/VIM to insert spaces instead of tabs. Learn the simple settings and commands to clean up your code.
Spaces vs. Tabs are generally annoying when editing files, but start programing in Python and this turns into a complete disaster. Simple solution, always insert Spaces instead of a Tab and you are good to go (my personal preference):
set tabstop=4set shiftwidth=4set expandtab
If you want to be really fancy:
:retab
Will convert all of the existing Tabs into Spaces.
Check out Converting tabs to spaces on the VIM Wiki.
