What's the canonical vi setting for Python indentation

Barry A. Warsaw bwarsaw at cnri.reston.va.us
Wed Dec 1 11:49:06 EST 1999


I don't know enough about vi configuration, but it would be good to
follow the simple rule that python-mode uses: if your indent level is
not equal to your tab width, use only spaces for all indentation.  So
for example, if you indent 4 spaces per level but your tab width is 8,
never use tabs, even if you're indenting two levels.

You can use tabs if your indent level is equal to your tab width,
e.g. your tab width is 8 and your indent is 8.

Note that the default for python-mode is to indent 4 spaces per level,
use a tab width of 8, and always use spaces.

-Barry




More information about the Python-list mailing list