Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for relative imports #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

guyzmo
Copy link

@guyzmo guyzmo commented Mar 23, 2016

fixes #4

@Ezra
Copy link

Ezra commented Nov 22, 2016

This works for me only if I cd my vim to be where the Python file is. It doesn't work relative to the file when my vim working directory is somewhere else.

@Ezra
Copy link

Ezra commented Dec 1, 2016

Specifically, the error when I "gf" on a relative import "from .ThatFile import *" is 'E447: Can't find file "/ThatFile" in path'. It might be relevant that when it does work, I get a double slash in the file path, like "ThatModule//ThatFile".

@guyzmo
Copy link
Author

guyzmo commented Dec 1, 2016

weirdly, since I upgraded to both vim8 and nvim, I'm having issues loading the plugin again in my current python install ☹ It might be because of VimPlug.

@guyzmo
Copy link
Author

guyzmo commented Dec 10, 2016

ok, I think I fixed the issue.

So, as far as I've tested, it's working with:

  • module_x
  • .module_a.module_b
  • ..module_y.module_z

with the path being relative to the buffer's file being open, not the current directory.

@guyzmo
Copy link
Author

guyzmo commented Dec 10, 2016

BTW, you can directly use:

Plug "guyzmo/vim-gf-python"

to have the relative support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for relative imports
2 participants