Is it possible to insert import statements with jedi-vim?
Question: I've just started looking at the Vim jedi plugin, and it seems pretty
impressive. One feature of some of the Java IDEs I've used is the ability to
automatically add required imports. Can Jedi do that? For example, if I enter
a line such as

    
    
    arg1 = sys.argv[1]
    

and then invoke some Jedi command, is it possible for the plugin to
automatically insert an `import sys` line at the top of the source file (if
sys is not already being imported)?

I've looked through the Jedi help, and can't see anything like this - but it's
possible I missed something. Alternatively, is there another Vim plugin that
would do this? (It needs a certain level of understanding of Python syntax to
get it right, which is why I looked to Jedi to be able to do it).


Answer: Currently Jedi doesn't do refactoringing. This includes import additions.
There's an issue for the whole subject:
<https://github.com/davidhalter/jedi/issues/667>.

It's not that easy to implement this command with good performance. However
any help is appreciated. :)

