sponsor Vim development Vim logo Vim Book Ad

indent/python.vim : An alternative indentation script for python

 script karma  Rating 1859/584, Downloaded by 37929  Comments, bugs, improvements  Vim wiki

created by
Eric Mc Sween
 
script type
indent
 
description
This indentation script for python tries to match more closely what is suggested in PEP 8 (http://www.python.org/peps/pep-0008.html).  In particular, it handles continuation lines implied by open (parentheses), [brackets] and {braces} correctly and it indents multiline if/for/while statements differently.

Comments are welcome!
 
install details
Drop the script in your ~/.vim/indent directory.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
python.vim 0.3 2005-05-23 6.0 Eric Mc Sween Changes:
- Update one shiftwidth instead of aligning with parens that stand at the end of a line.
python.vim 0.2 2004-06-07 6.0 Eric Mc Sween Changes:
- Fix: skip parentheses in strings and comments.
- Line up elif/else and except/finally with the most probable corresponding if or try statement.
- Dedent after 'pass'. (Jeffrey Collins)
python.vim 0.1 2004-04-26 6.0 Eric Mc Sween Initial upload
ip used for rating: 44.220.184.63

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github