What's the canonical vi setting for Python indentation
Malcolm Tredinnick
malcolmt at smart.net.au
Tue Nov 30 19:17:51 EST 1999
On Tue, Nov 30, 1999 at 11:46:10PM +0000, Sean Blakey wrote:
> I don't know about canonical, but I have the following in my .vimrc
> set expandtab "Turn's tabs into spaces
> set hardtabs=4 "Make tabs 4 spaces wide
> set tabstop=4
> set shiftwidth=4 "For use with << and >>
I tend to avoid 'set expandtab' to save typing. If I want to back out from one
indentation level to the previous one, it takes a single BackSpace to do so.
If I am using the 'expandtab' setting, it takes four keystrokes (these things
matter to me). Of course, I am also using the 'autoindent' setting (but, then
again, doesn't everybody in vim?).
To avoid making this a complete "me too" post, I'll point out that the "retab"
command is useful at some points, too. After I've edited a program to more or
less completeness, if I'm going to email it or print it, I will do
:se et
:1,$ret
You can go back the other way by doing
:se noet
:1,$ret! <--- Changing sequences of spaces back to tabs
This way I get the best of both worlds -- efficient typing speeds, but
something that doesn't rely on the receiver's (printer or email adressee) tab
settings to look the same as my on-screen copy.
Cheers,
Malcolm Tredinnick
--
42.7 percent of all statistics are made up on the spot
More information about the Python-list
mailing list