Function editing with Vim throws IndentError

Matimus mccredie at gmail.com
Thu Jul 24 16:02:41 EDT 2008


On Jul 24, 2:54 am, Lawrence D'Oliveiro <l... at geek-
central.gen.new_zealand> wrote:
> In message
> <f558e635-aa40-4d54-bd1a-45e8463cd... at v26g2000prm.googlegroups.com>,
>
> Matimus wrote:
> > That isn't the standard. With that setup tabs will show up as 4
> > spaces, and still confuse you.
>
> Why should that be confusing? The most common tab-stop setting is 4 columns.

I think if you continued reading my post you would see. The tabstop
feature in Vi(m) sets how many spaces a tab character is displayed as.
A tab character is specified as 8 spaces. The real problem is that the
python interpreter itself follows the spec and interprets a tab as 8
spaces. If you are viewing the code and have mixed tabs and spaces and
all of the tabs are showing up as 4 spaces you will not be able to
spot the issues that will come up.

4 columns is not the most common setting, the most common setting is
the default, which is 8. It is just very common for people to change
it. I suggest that instead of changing the tabstop, just use spaces
(not both) and use the `softtabstop` setting to allow a press of the
tab key to insert four spaces instead.

Matt



More information about the Python-list mailing list