Tabbing/Spaces

Alex Martelli aleaxit at yahoo.com
Sat Jan 20 07:42:58 EST 2001


"Fredrik Lundh" <fredrik at effbot.org> wrote in message
news:n3aa6.7716$AH6.1213290 at newsc.telia.net...
    [snip]
> > But surely there's a simple way to please both -- aren't
> > there de-tabbing filters I can use to substitute spaces for tabs
> > (or vice-versa)?  What _I_ find really irritating is that my code
> > usually winds up being a mixture of the two.
>
> I'm pretty sure your editor can do it for you (I'll leave
> it to the vim gurus to explain how).

The :retab command is what you use for this task in vim.

If you've set expandtabs to 1, :%retab will change all
tabs to the appropriate number of spaces (you can also
give it the tabstop size you want as an argument); if
you've set it to 0, :%retab! will insert tabs wherever
possible (again, you can pass tabstop size as argument).


Alex






More information about the Python-list mailing list