Wednesday, December 23, 2009

Python: module-aware jumping to class definition - possible?

Hi!

Lets assume I got InterestingClass definitions in various python
modules.
I've set proper PYTHONPATH for VIM.

I'm heavy wondering whether it is possible to jump from:
### my/package/one.py
from my.other_package.two import utils
class Foo(utils.InterestingClass): ## HERE, cursor placed on
"InterestingClass"
pass
###
...directly to InterestingClass definition in my/other_package/two/
utils.py?

Jumping using ctags and Ctrl-] is a bit dumb, because it matches
classes only by name, ignoring from ... import statement, so I have to
manually choose from multiple matches.

My PYTHONPATH is set correctly for VIM, so it can use it to figure out
in which source file it should look up InterestingClass definition:
:python from my.other_package.two import utils (runs without any
error)

pydev plugin for eclipse can do that, why VIM would not? :-)
It would definitely be a killer feature for pythoners!

Cheers!

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments: