Learn ralph small Learn

Navigating Ruby Files with Vim

Stop scrolling and searching, start precision jumping

One sign of an inexperienced Vim user is wasted time spent navigating within and between files. They search manually for method definitions, and type out long path-names to access files.

In this three-part series of screencasts, Drew Neil (author of Practical Vim and creator of vimcasts.org) will save you from this fate by teaching ultra-efficient navigation through Ruby code.

With Drew’s help, you’ll learn to jump directly to the class, method, or file you’re interested in with minimal keystrokes. You’ll cease to care whether something is defined in your project, a bundled gem, or the standard library.

With these skills mastered, you’ll learn to rely less on documentation, preferring to simply jump to the source of the Ruby or Rails methods you’re using.

This ability won’t just save you time, but will help you gain a deeper understanding of the gems and standard library code that you use every day.

Along the way, you’ll also learn how to make Ruby blocks a first-class text object in Vim. This lets you edit Ruby code at a higher level of abstraction. Once you try it, you’ll never want to go back.

Three videos are included:

Navigation within Ruby Files (8:47)

  • Jumping between methods, modules, and classes

  • Turning Ruby blocks into first-class citizens

  • Manipulating Ruby code at a higher-level of abstraction

Navigation between Ruby files (16:15)

  • Jumping to files within your project

  • Jumping to files in bundled gems

  • Jumping to files in the Ruby standard library

  • Using :find effectively

  • Fixing “Can’t find file ‘foo.rb’ in path”

  • A trio of useful plugins to improve navigation

Intelligent navigation with ctags (15:23)

  • Configuring ctags

  • Efficient jumps using tagfiles

  • Navigating the taglist

  • Automatically indexing your projects, gems, and standard library