Python’s syntax relies on indentation for statement grouping. The convention is to use spaces, but I’ve always found tabs to be easier to work with in vim. My largest gripe: if I mis-tabbed, I had to press “delete” four times to erase all the spaces I created. Turns out, that needn’t be the case: vim can detect multi-space indentation and delete one “tab” at a time.
Here are some good resources I found while digging into this:
- Secrets of tabs in vim
- Notes on using Vim and Python — check out the autoindentation based on file name, just below the main table
- Converting tabs to spaces
Bonus: check out vimrc in the python “Vim” folder for other helpful files.
I like to think of myself as being “creatively lazy”; I just use two space indentation in vim
- Paddy.