sponsor Vim development Vim logo Vim Book Ad

ri-browser : Ruby Information at your fingertips

 script karma  Rating 29/12, Downloaded by 1817    Comments, bugs, improvements  Vim wiki

created by
Jonas Fonseca
 
script type
ftplugin
 
description
Interface for browsing ri/ruby documentation.

Defines the following commands:

  :Ri <arg>
      Lookup the given argument.

  :RiExpand <arg>
      Lookup the given argument but prefix the class/module name
      when in Ri class buffer[1].

and the following mappings:

  <M-i>  Clean prompting for lookup word.
  <M-I>  Prefix class/module if any before prompting. (ex: Array#)

Lookups can also be done using the word under the cursor (WUC)

  <M-]>
      Gready expansion of WUC. This will work for both the
      'Array.new', 'Hash#each' and 'Kernel::block_given?' way of
      specifying a method.

  <M-[>
      Not so gready expansion of WUC but will also prefix the
      class/module when in a Ri class/module buffer[1]. This makes
      it possible to lookup 'Array#each' by invoking it with
      the cursor places on 'each' in the 'Array' class buffer.

[1] A Ri class/module buffer is a buffer showing all the methods belonging
    to a class or modul. Example: typing ':Ri Hash' followed by enter in
    normal mode with the ri plugin loaded will open the 'Hash' class buffer.

Comes with syntax coloring of the Ri buffer.

Inspired by ri stuff at http://www.rubygarden.org/ruby?VimExtensions
Credits to vimscript #90 for much of the lovely code.
 
install details
Unzip the installation file in you vim directory and it will 'install' the files:

  ftplugin/ri.vim
  syntax/ri.vim
  doc/ri.txt

Then add something like

  " Load ri interface
  source path/to/ftplugin/ri.vim

to your ftplugin/ruby.vim to load it when editing ruby files.

For futher documentation on installation and usage take a look at the file doc/ri.txt
 

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
ri-browser.zip 1.2 2002-11-28 6.0 Jonas Fonseca Better syntax highlighting and word expansion.
Docs moved to doc/ri.txt and improved.
Changed some of the optionnames and default settings.
ri-browser.zip 1.0 2002-11-24 6.0 Jonas Fonseca Initial upload
ip used for rating: 184.73.40.21

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