Search code examples
python-3.xvimpydoc

How can i make shortcut for pydoc?


I'm trying to add vim shorcut for pydoc.

I use this shortcut now.

nnoremap <buffer> K : <C-u>execute "!python3 -m pydoc " . expand("<cword>")<CR>

But this shortcut doesn't work with downloaded library.

Example, it works at os.listdir and doens't work at np.zeros

So I type :python3 -m pydoc numpy.zeros to find document of numpy.zeros.

How should I fix my shortcut to work like :$myshortcut numpy.zeros?

Thank you.


Solution

  • I solved it. I download this code

    and I fixed a line to use with python3

    let g:pydoc_cmd = 'python3 -m pydoc'
    

    Thanks.