ri-browser


Ⅰ. 插件描述

Ruby Information at your fingertips

Ⅱ. 基本信息

创建日期:  2002-11-24
使用用户:  1
Github星:  2
插件作者:  Jonas Fonseca

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '/ri-browser'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '/ri-browser'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '/ri-browser'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/ri-browser

Ⅳ. 文档说明

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.

添加新评论