Coder Social home page Coder Social logo

apidock.vim's Introduction

apidock.vim

This plugin allows you to browse APIdock's Ruby, Rails, and RSpec docs from within Vim. It will invoke Firefox from the command line, and open the query in a new tab.

The plugin uses the command 'firefox', which it expects to be in your path, and executable from your shell. See 'Customization' below if you need some other behavior. (In particular, all of you OSX users will have to make a small change.) This should work out of the box on Ubuntu, and most other Linux-based systems on which Firefox is installed.

The Official Version of ack.vim is available at vim.org.

Installation

If you have Rake installed, you can just run: rake install.

The file apidock.vim goes in ~/.vim/plugin, and the apidock.txt file belongs in ~/.vim/doc. Be sure to run

:helptags ~/.vim/doc

afterwards.

Usage

  • RR - Search the Rails docs for the word under the cursor.

  • RB - Search the Ruby docs for the word under the cursor.

  • RS - Search the RSpec docs for the word under the cursor.

Origin Story

This Vim plugin is mostly copied from the AkitaOnRails guys' vimfiles on GitHub. In particular, this commit by Cassio Marques on January 10th, 2009. I just added the RSpec function, the help docs, and then threw it up on GitHub. However, do bug me if something isn't working.

Customization

If you don't want to use Firefox, the fix is pretty simple. Edit ~/.vim/plugin/apidock.vim, and edit the line (should be line #1),


  let g:browser = 'firefox -new-tab '

using the shell command for your preferred browser.

In OSX, you'll want to change the previously mentioned line to


  let g:browser = 'open -a /Applications/Firefox.app'

You may also need to remove the three ampersands in the file. Davey did, anyway, as it wouldn't work with them. I have no idea why. Perhaps the 'open' command has problems with running asynchronously. Maybe the ampersand insulted its mother. Simply deleting the ampersand character will do, but you are welcome to remove everything after (and including) the final period from each line with an ampersand, if you'd like.

apidock.vim's People

Contributors

marocchino avatar mileszs avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.