sponsor Vim development Vim logo Vim Book Ad

pyref.vim : Context-sensitive documentation for Python source code

 script karma  Rating 23/8, Downloaded by 6762  Comments, bugs, improvements  Vim wiki

created by
Peter Odding
 
script type
utility
 
description
The file "pyref.vim" is a plug-in for the Vim text editor that maps the <F1> key in Python buffers to search through the Python language and library reference documentation for the keyword or identifier at the current cursor position and open the first match in your web browser. When no GUI is available a command-line web browser like lynx or w3m will be used, otherwise the plug-in prefers a graphical web browser like Mozilla Firefox or Google Chrome. For more information about the plug-in please refer to its homepage or the project page on GitHub:

http://peterodding.com/code/vim/pyref/
http://github.com/xolox/vim-pyref

If you have questions, bug reports, suggestions, etc. the author can be contacted at peter@peterodding.com. If you like this plug-in please vote for it below!

ALTERNATIVES
If you don't like using your web browser to read documentation but would rather do so inside Vim, or if you need the documentation of a module that's not in the Python standard library, try vimscript #910 and vimscript #1112. Both of these use the "pydoc.py" Python script included with the standard Python installation, which means they automatically work on all modules known to Python (including user-defined modules).
 
install details
Unzip the most recent ZIP archive file (see below) inside your Vim profile directory (usually this is "~/.vim" on UNIX and "%USERPROFILE%\vimfiles" on Windows), restart Vim and execute the command ":helptags ~/.vim/doc" (use ":helptags ~\vimfiles\doc" instead on Windows). Now try it out: Open a Python script and press the <F1> key on any interesting identifier. If it doesn't work at first, please check the README included in the ZIP.
 

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
pyref.zip 0.7.16 2013-08-19 7.0 Peter Odding • Remove embedded miscellaneous scripts (they need to be installed separately from now on):
   http://github.com/xolox/vim-pyref/commit/712b775
> • Document vim-misc as external dependency:
  
http://github.com/xolox/vim-pyref/commit/d57636a
> • Make sure vim-misc is installed, politely complain if it isn't:
  
http://github.com/xolox/vim-pyref/commit/75da45a
> • Remove vim-misc compatibility check (missed that):
  
http://github.com/xolox/vim-pyref/commit/a06070e
pyref.zip 0.7.14 2013-05-20 7.0 Peter Odding • Updated miscellaneous scripts:
   http://github.com/xolox/vim-pyref/commit/bbdad43
pyref.zip 0.7.13 2013-05-19 7.0 Peter Odding • Updated miscellaneous scripts:
   http://github.com/xolox/vim-pyref/commit/7ef2448
pyref.zip 0.7.12 2013-05-13 7.0 Peter Odding • Updated miscellaneous scripts:
   http://github.com/xolox/vim-pyref/commit/21f503f
  
; http://github.com/xolox/vim-pyref/commit/9c88b0e
pyref.zip 0.7.11 2013-05-02 7.0 Peter Odding • Updated miscellaneous scripts:
   http://github.com/xolox/vim-pyref/commit/35c639e
pyref.zip 0.7.10 2013-04-28 7.0 Peter Odding • Updated miscellaneous scripts:
   http://github.com/xolox/vim-pyref/commit/87c783d
pyref.zip 0.7.9 2013-04-21 7.0 Peter Odding • Make compatibility with miscellaneous scripts explicit:
   http://github.com/xolox/vim-pyref/commit/d486822
pyref.zip 0.7.8 2011-11-26 7.0 Peter Odding • Updated miscellaneous scripts:
   http://github.com/xolox/vim-pyref/commit/11cba18
  
; http://github.com/xolox/vim-pyref/commit/63289db
  
; http://github.com/xolox/vim-pyref/commit/9b4c774
pyref.zip 0.7.7 2011-11-21 7.0 Peter Odding • Updated miscellaneous scripts:
   http://github.com/xolox/vim-pyref/commit/ce002d6
pyref.zip 0.7.6 2011-09-25 7.0 Peter Odding • Updated miscellaneous scripts:
   http://github.com/xolox/vim-pyref/commit/927aeff
pyref.zip 0.7.5 2011-09-04 7.0 Peter Odding • Move the index (and spider) to the proper location:
   http://github.com/xolox/vim-pyref/commit/42ad155
> • Define version as variable, include in messages:
  
http://github.com/xolox/vim-pyref/commit/42ed86b
> • Updated miscellaneous scripts
pyref.zip 0.7 2010-12-19 7.0 Peter Odding Now with out of the box support for Django documentation:
https://github.com/xolox/vim-pyref/commit/2982ea5c73d78d7d2b39
pyref.zip 0.6 2010-09-18 7.0 Peter Odding • Moved OpenBrowser() to external autoload plug-in:
   http://github.com/xolox/vim-pyref/commit/b059112e6d111f84cb35

• Added :PyRef command, converted to autoload script:
   http://github.com/xolox/vim-pyref/commit/a37a24fe6630f40d7145
pyref.zip 0.5 2010-06-08 7.0 Peter Odding * Make all searches case-sensitive since Python is as well
* Search for substring match on word boundaries
* Progressively smaller suffix search now uses word boundary
* If verbose is >= 1 pyref.vim reports used search patterns

See the changeset at http://github.com/xolox/vim-pyref/commit/175bf469a0c556f8596604892ce2c309f19582d7
pyref.zip 0.4.2 2010-06-06 7.0 Peter Odding Fixed broken links in README
http://github.com/xolox/vim-pyref/commit/5dd2e8b539d73a1c7dd01688bb6947f46a827396
pyref.zip 0.4.1 2010-06-06 7.0 Peter Odding Includes generated Vim documentation based on README
pyref.zip 0.4 2010-06-03 7.0 Peter Odding * Moved all remaining documentation from pyref.vim to README.md
  http://github.com/xolox/vim-pyref/commit/218990f6c228ff0bcf2cd70e48cba5cc443da25d

* Re-organized the plug-in to make it auto-update compatible (using the getscript plug-in).
  This also simplifies installation: Just unzip the latest release inside your ~/.vim/ directory.
  http://github.com/xolox/vim-pyref/commit/16ba180113f4c6c3eded4706fb319746dd9f7aae

* Support for exceptions imported from the `exceptions` module
pyref.zip 0.3 2010-06-03 7.0 Peter Odding * Bug fix: Don't map insert mode when mapping is printable character
  http://github.com/xolox/vim-pyref/commit/2d45371f62b9eb274b837ce084c1ad77710af713

* Improved auto-detection of the appropriate browser (CLI vs. GUI)
  http://github.com/xolox/vim-pyref/commit/dd6901c84f9e2b863d05963a2673b7f8b71adcd8

* Resolve object attributes to standard library identifiers.
  http://github.com/xolox/vim-pyref/commit/bf6751d5fb6a3e7f9babe114269a3de85be8d319

* Included README.html for people who don't like Markdown :-)
pyref.zip 0.2 2010-05-26 7.0 Peter Odding Initial upload
ip used for rating: 3.239.59.193

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.
   
Vim at Github