using vim as a python class/module/function etc.. browser

Daniel Nogradi nogradi at gmail.com
Tue Apr 11 03:58:02 EDT 2006


> >>Of course, modern versions of Exuberant Ctags also support Python, too.
> >
> > I apt-installed this package but the man page is rather intimidating so
> > I thought I might as well make sure I was going in the right direction.
>
> You will probably want to read the vim documentation on how to use ctags
> from
> vim. That will tell you all you need to know without extraneous cruft.
>
> > Just need to verify that the stable version (sarge) is modern enough..
>
> It ought to be. It has supported Python for years and years.

For browsing source code I found the folding feature of vim very
useful. It collapses the body of function and class definitions into
one line so you can have a general overview of definitions in the
code. It is available from version 6 up and I recently wrote a vim
plugin specifically for folding python source code. You can find it
here: http://www.vim.org/scripts/script.php?script_id=1494

There is also an excellent vim plugin by Yegappan Lakshmanan for
working with 'tags' files using ctags. It displays all your function
and class definitions (from multiple files if you wish) in a narrow
vertical window where you can easily jump to the file containing a
chosen definition. This script is here:
http://www.vim.org/scripts/script.php?script_id=273

HTH,
Daniel



More information about the Python-list mailing list