Vim logo vim online Vim Book Ad

python_fold.py : Folding expression for python

 script karma  Rating 23/8, Downloaded by 158

created by
Jorrit Wiersma
 
script type
utility
 
description
This script uses the expr fold-method to create folds for python source code.

Folds are created for:
- Class definitions
- def function definitions
- Blocks between {{{, }}} markers (but not yet {{{n, etc.)

Bugs:
- It sometimes creates a spurious fold at strange places, but this happens
  rarely.
 
install details
Either save it in a file and source that file whenever you want to use the folding, or save it in your shared ftplugins directory and it should load every time you edit python code.
 

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_fold.vim 1.1 19-Dec-2002 6.0 Jorrit Wiersma Fixed small bug (didn't look for whitespace after def or class)
python_fold.vim 1 19-Dec-2002 6.0 Jorrit Wiersma Initial upload

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 [email protected] after searching the archive. Help Bram help Uganda.
SourceForge Logo