Browse Ruby RSpec and Rails API docs quickly with Vim
VimL Ruby
Pull request Compare This branch is 25 commits behind lucapette:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


vim-ruby-doc is a little plugin that helps you to look up Ruby/Rails/Rspec documentation using the good

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


I strongly recommend installing pathogen.vim.

cd ~/.vim/bundle
git clone git://

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

How to use it

When your cursor is on something you would look up on apidock, 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.

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 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.


The only feature I've already planned to add is commands for searching arbitrary stuff. Something like :RubyDoc foo for example. I'd like to add support for Windows but I'm not going to do it. So pull-requests are more than welcome. If you have suggestion, I'll be glad to hear it from you.

Know Issues

At this very moment, the plugins works only with GUI versions of Vim. I've planned to fix that. Anyway, a pull-request would be more than welcome. If you run into other issues, please open one here on github.


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