I believe that I once saw a plugin which allowed one to see the result of evaluating ruby expressions inside a buffer.Eg, if I wrote a line like3 + 2 # =>and pressed the required magic keys, the line would change to: 3 + 2 # => 5I know that there are way to invoke vim from irb, but what I'm after is more like invoking irb from inside vim.I can't find that plugin now - does such a thing indeed exist?
How to evaluate a ruby expression in a buffer
filetype ruby
There are actually several way to do that.The first google result is the vim-ruby-eval plugin which provides the :RubyEval command. Here is a screen cast coming from the README page of the plugin:This plugin requires +ruby (:echo has('ruby') should return 1)You can also do this with the xmpfilter command provided by the rcodetools ruby gem. As this blog post says, there is a vim plugin for xpmfilter: vim-ruby-xmpfilterNote that the plugin doesn't provide default mappings you'll have to set them by yourself but the README as a good amount of example to help you.