sponsor Vim development Vim logo Vim Book Ad

pythonhelper : Displays Python class, method or function the cursor is in on the status line

 script karma  Rating 634/180, Downloaded by 6927  Comments, bugs, improvements  Vim wiki

created by
Michal Vitecek
 
script type
utility
 
description
Vim script to help moving around in larger Python source files. It displays current class, method or function the cursor is placed in in the status line for every python file. It's more clever than Yegappan Lakshmanan's taglist.vim because it takes into account indetation and comments to determine what tag the cursor is placed in and from version 0.80 doesn't need exuberant ctags utility.

Note: The script displays current tag on the status line only in NORMAL mode. This is because CursorHold event in VIM is fired up only in this mode. However if you'd like to know what tag you are in even in INSERT or VISUAL mode, contact me (email specified in the script) and I'll send you a patch that enables firing up CursorHold event in those modes as well.
 
install details
1. Make sure your Vim has python feature on (+python). If not, you will need to recompile it with --with-pythoninterp option to the configure script
2. Copy script pythonhelper.vim to the $HOME/.vim/plugin directory
3. Run Vim and open any python file.
 

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
pythonhelper.vim 0.83 2010-01-04 7.0 Michal Vitecek Added support for the CursorHoldI event so that the class/method/function is recognized also in Insert mode.
pythonhelper.vim 0.82 2009-07-10 6.0 Michal Vitecek - fixed a bug when nested functions/classes were not properly detected
pythonhelper.vim 0.81 2003-03-13 6.0 Michal Vitecek - fixed a small bug in indent level recognition
pythonhelper.vim 0.80 2002-10-18 6.0 Michal Vitecek - removed the dependency on exuberant ctags which parsed the python source code wrongly anyways. From now on only VIM with python support is needed. This might greatly help windoze users.
pythonhelper.vim 0.72 2002-10-03 6.0 Michal Vitecek - fixed problem with parsing ctags output on python files that use tabs
- when there is a syntax error in the file and ctags parses it incorrectly a warning is displayed in the command line
pythonhelper.vim 0.71 2002-10-02 6.0 Michal Vitecek - fixed problem with undefined window-bound variable w:PHStatusLine when a window has been split into two.
- unbound event BufWinEnter because it's not needed because of the above change now
pythonhelper.vim 0.7 2002-10-02 6.0 Michal Vitecek Initial upload
ip used for rating: 3.94.202.151

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