What's the canonical vi setting for Python indentation

William Park parkw at better.net
Tue Nov 30 19:14:14 EST 1999


On Wed, Dec 01, 1999 at 10:19:06AM +1100, Chris WRIGHT wrote:
> I've tried to find out the "OK" indentation settings for python with vi,
> and a troll through deja-news found some hints (like don't do indent =
> 4). Yet I seem to also remember some advice to the contrary?? I want
> indentation to be 4 characters, and readable by/ acceptable to emacs
> python-mode, and to pass tabnanny...

I use 'vim', and my ~/.vimrc contains (among other things)
    set smarttab	" use 'shiftwidth' at beginning of line
    set shiftwidth=4	" use 4 spaces for indenting
    " indentation after Python keywords
    autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class

	Yours truly,
	William Park

> 
> I think that this should go in the faq...(Couldn't find it from
> www.python.org search)
> 
> 
> cheers
> and thanks
> 
> chris wright
> -- 
> Dr. Chris Wright
> Deputy Director, Intensive Care Unit
> Monash Medical Centre




More information about the Python-list mailing list