vim-gf-python
vim-gf-python copied to clipboard
Added support for relative imports
fixes #4
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.
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".
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.
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.
BTW, you can directly use:
Plug "guyzmo/vim-gf-python"
to have the relative support.