vim-ruby-doc


Ⅰ. 插件描述

Browse Ruby RSpec and Rails API docs quickly with Vim

Ⅱ. 基本信息

创建日期:  2012-01-29
使用用户:  46
Github星:  67
插件作者:  lucapette

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/lucapette/vim-ruby-doc

Ⅳ. 文档说明

vim-ruby-doc is a little plugin that helps you to look up documentation using
the following resources:

  • Ruby

rubydoc.info

  • RSpec

relishapp.com

  • Rails

http://api.rubyonrails.org

If you want something similar for jQuery API documentation see
vim-jquery-doc.

Installation

I strongly recommend installing pathogen.vim.

cd ~/.vim/bundle
git clone git://github.com/lucapette/vim-ruby-doc.git

Or you can unzip it in your ~/.vim directory.

How to use it

In Normal mode, when your cursor is on something you would look up type:

  • RB for Ruby
  • RS for RSpec
  • RR for Rails

and the plugin will open a new tab in your browser (or a new instance of the
browser) to the related docs. See the following section for changing mappings.

Furthermore, the plugin defines the following commands for searching on the
command-line arbitrary stuff:

  • :RubyDoc
  • :RspecDoc
  • :RailsDoc

Configure it

By default, the plugin uses the
xdg-open
command to look up the docs but you can easily change the command. For
example, if you are on OSX you would like to change it:

let g:ruby_doc_command='open'

Furthermore you can choose your own mapping in the following way:

let g:ruby_doc_ruby_mapping='KK'

There are g:ruby_doc_rspec_mapping and g:ruby_doc_rails_mapping variables
too.

You can change where the plugin should search very easily:

let g:ruby_doc_ruby_host='http://apidock.com/ruby/'

Contributors

Include /doc/tags in .gitignore.

Move away from apidock.

Add configurable search host.

Moving mappings to filetype directory

License

Copyright (c) Luca Pette. Distributed under the same terms as Vim itself. See :help license.

添加新评论