In vim, you can use ⌃] to go to the function definition if you’ve set up ctags, but I’ve had a problem with gems because they weren’t located in the same project directory.

One way to get this working is by setting your path so it knows where is your gem.

File: .vimrc

set path+=/Users/ckim/.rvm/gems/ruby-2.1.5/gems/nokogiri-1.6.6.2/lib/

But this means you’d have to do it for every gem and that’s a lot of maintaining.

Chris Lamb showed me a simpler solution: just include your gems in your project directory and run the ctags as you’d normally do.

$ bundle install --path .bundle
$ ctags -R .

Now I’m able to jump into the gem’s source code as easily as the rest of my code in my project.