sponsor Vim development Vim logo Vim Book Ad

pydoc.vim : Python documentation view- and search-tool (uses pydoc)

 script karma  Rating 185/71, Downloaded by 5982

created by
André Kelpe
 
script type
utility
 
description
This plugin integrates the python documentation view- and search-tool "pydoc" into (g)vim. The plugin allows yout to view the documentation of a python-module or class by typing

:Pydoc foo.bar.baz (e.g. :Pydoc re.compile)

or search a word (uses pydoc -k) in the documentation by typing

:PydocSearch foobar

Vim will split a new buffer, which shows the python-documentation found by pydoc. (The buffer is called "__doc__" (pythonic, isn't it ;-) ). The name might cause problems, if you have a file with the same name, but usually this should not happen).

pydoc.vim also allows you view the documentation of the "word" (see :help word) under the cursor by pressing <leader>pw or the "WORD" (see :help WORD) under the cursor by pressing <leader>pW. This is very useful if you want to jump to the docs of a module or class found by "PydocSearch" or if you want to see the docs of a module/class in your source code.

To have a browser like feeling you can use "u" and "CTRL-r" to go back and forward,  just like editing normal text in a normal buffer.

If you have suggestions for pydoc.vim, feel free to contact me (fs111 at web dot de) and if you like it, please rate it :-)

P.S.: There is also another script, which integrates pydoc into vim, you can find it here: http://www.vim.org/scripts/script.php?script_id=1112
 
install details
Just put "pydoc.vim" into your ~/.vim/plugin directory or source it whenever you want to.

If the pydoc-command is not in your PATH, you can put a line like let g:pydoc_cmd = "/usr/bin/pydoc"  in your .vimrc to get it working. The script will highlight the search-term by default. To disable this behaviour put "let g:pydoc_highlight=0" in your .vimrc.

Note: You do not need a python enabled version of vim to use pydoc.vim, everything is done with plain vim scripting and should work on any version >6.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
pydoc.vim 1.1.1 2005-03-06 6.0 André Kelpe The highlighting of the search-term is now optional and can be disabled.
Set in  this in your .vimrc to disable the highlighting:

let g:pydoc_highlight=0

pydoc.vim 1.1 2004-11-15 6.0 André Kelpe This updates adds a simple highlighting to pydoc.vim. All occurrences of your search-term will be highlighted. It uses gui=reverse to be color-scheme independent.
pydoc.vim 1.0.6 2004-10-08 6.0 André Kelpe Version 1.0.5 contains some debug code (call to "input" twice), this versions removes it. Sorry for that.
pydoc.vim 1.0.5 2004-10-08 6.0 André Kelpe Small workaround to get pydoc.vim working correctly if "(" is appended to "iskeyword", like in the pydiction setup (http://www.vim.org/scripts/script.php?script_id=850). Thanks to sertac from #vim@irc.freenode.net for reporting the problem.

If you are using pydiction and pydoc.vim, you should upgrade.
pydoc.vim 1.0.4 2004-07-16 6.0 André Kelpe Changed the defaut mappings, because many other scripts are using the Function-keys. New mappings are <leader>pw for the current word and <leader>pW for the current Word.
pydoc.vim 1.0.3 2004-02-17 6.0 André Kelpe another small bugfix, I hope the last for today!!
pydoc.vim 1.0.2 2004-02-17 6.0 André Kelpe missing blank in "pydoc -k" fixed
pydoc.vim 1.0.1 2004-02-16 6.0 André Kelpe This version uses the g:pydoc_cmd variable which makes the script usable if the pydoc command is not in  your PATH. This may also work an Windows, but I can't test that. Feedback welcome. Just put a line like

let g:pydoc_cmd = "/usr/bin/pydoc"

into your .vimrc and the scritp will use the specified command.
pydoc.vim 1.0 2004-02-12 6.0 André Kelpe Initial upload

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo