On 2006-07-19, John Reese <[EMAIL PROTECTED]> wrote:
> On 7/13/06, Gary Johnson <[EMAIL PROTECTED]> wrote:
> > A lot of this is already incorporated into the
> > $VIMRUNTIME/ftplugin/python.vim plugin. For example, gf works fine
> > with Python import statements.
>
> Actually, that's my point. gf does _not_ work for Python imports that
> have a from clause. The paradigm is different from #include files,
> where the identifier under the cursor is enough information to find
> the file. In Python, you need the whole line.
>
> i.e.:
> from myproject.something.blar.blag import Bok
> if you put the cursor over Bok and hit gf, no dice.
I wouldn't expect that to work because Bok is not a file but an
object within the file myproject/something/blar/blag.py. If you put
the cursor over "myproject.something.blar.blag", on the other hand,
it should open that file.
> If the import
> line is rewritten as
> import myproject.something.blar.blag.Bok as Bok
> and you put the cursor over the second word, it works fine.
I would expect that to work, and it confirms that your 'path' is set
correctly.
All that being said, I'm new at using vim to edit Python files, so I
may be misunderstanding something.
Regards,
Gary
--
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Wireless Division
| Spokane, Washington, USA