In eclipse you can hit Ctrl+Shift+o to automatically import all the libraries you reference in your code. Is there any similar plugin for vim to have this feature with python?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
There is a command line tool called
mr.igor
that you could install. There are instructions for hooking it up to vim on the pypi page:http://pypi.python.org/pypi/mr.igor
There is ropevim. It is available on pypi as well
The autoimport (adds missing imports) and organizeimport (reorder imports) features work well, but it is a little invasive at times (it will create a .ropeproject folder in your project). Rope code completion is also quite good so I use standard code completion with tab, and when it's not enough, I use ctrl-space to use ropevim autocompletion.
Here are some of my mappings with ropevim:
I'm using https://github.com/mgedmin/python-imports.vim together with gutentags. Good enough for me (and better than nothing).