I've been looking around for a while now but I couldn't find a proper answer.

I would like to access python documentation from Vim. I know that some plugins exist (like this one: https://github.com/fs111/pydoc.vim). But these plugins are far from perfect. WIth pydoc for example, if you press K on a word, you'll get the documentation.


import matplotlib.pyplot

If you K on pyplot, you'll get the documentation. But if you have:

import matplotlib.pyplot as plt

If K on plt, you won't get anything.

There is also the jedi plugin, which displays documentation on the fly. If you type plt., it will display the objects/methods of plt. But you need to be typing for that.

Also, I think none of these plugins work on the code present in the same folder but imported in the current file. For example, if my_module is implemented in a folder, and if I import it in my_script.py, I don't have access to the documentation from my_module.

Do you have any idea how to improve my situation please?


I am using jedi-vim which can show the documentation for modules and functions. By default, it uses K to look up documentation.

Since it relies on Jedi, you must install Jedi package first:

pip install jedi
# or conda install jedi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.