interactive editor in irb
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib Bump version Oct 22, 2017
.gitignore initial commit May 15, 2010
LICENSE add missing license stuff Apr 13, 2011 README Sep 6, 2011
Rakefile Link to TechRepublic article Apr 26, 2011
interactive_editor.gemspec Bump version Oct 22, 2017

Interactive editor

Drew Neil has made it the subject of one of his vimcasts: vimcasts #20: running Vim within IRB, and Chad Perrin has written an article about it on TechRepublic: Use interactive_editor with irb for an inside-out Ruby IDE. There's also an outdated blog post which predates the gem from 2009: Integrating vim and IRB.


$ gem install interactive_editor

Put the following in your .irbrc:

require 'rubygems'
require 'interactive_editor'

Then, from within irb:

$ irb                        # or ripl
> vi                         # (use vi w/ temp file)
> vi 'filename.rb'           # (open filename.rb in vi)
> ed                         # (use EDITOR env variable)
> [emacs|vim|mvim|nano|mate] # (other editors)

Bonus: editing of objects on the fly (inspired by _why's object aorta)

$ irb
> { 'chunky' => 'bacon' }.vi

To try it out without installing the gem:

$ git clone git://
$ cd interactive_editor
$ rake console

interactive_editor also works with the IRB alternatives ripl and pry.


Giles Bowkett, Greg Brown, and several audience members from Giles' Ruby East presentation: Use vi or any text editor from within IRB.

With contributions from: