VIM and IRB

F

Frank Fischer

Hi,

my favourite editor for programming is Vim. When editing some ruby-scripts I
usually have an xterm open with a running irb-session. When testing some
code snippets, I copy & paste them to IRB. In Emacs I could evaluate those
snippets in an inferior-ruby session within Emacs. I do not know how to
this in Vim, so I wrote a little vim-plugin called 'vinfruby' to do
something similar.

vinfruby starts an xterm with an IRB session and uses DRb to communicate
with the Vim-plugin. The plugin then sends the code to be evaluated on
keypress to IRB, for example just press '\rt' to open an irb session, '\rf'
to send the whole file to irb or '\rd' to send the current 'def..end'
block.

I do not know, but perhaps someone may find this script useful so I decided
to post it here in the news. Just extract the files from

http://www-user.tu-chemnitz.de/~fifr/downloads/vinfruby.tgz

to ~/.vim/plugin. The file 'vinfruby.vim' explains the key-mappings. The
plugin is neighter complete nor pretty well tested, but it works for me.



Hope it may be useful,

Greetings,

Frank.
 
L

Logan Capaldo

Hi,

my favourite editor for programming is Vim. When editing some ruby-scripts I
usually have an xterm open with a running irb-session. When testing some
code snippets, I copy & paste them to IRB. In Emacs I could evaluate those
snippets in an inferior-ruby session within Emacs. I do not know how to
this in Vim, so I wrote a little vim-plugin called 'vinfruby' to do
something similar.

vinfruby starts an xterm with an IRB session and uses DRb to communicate
with the Vim-plugin. The plugin then sends the code to be evaluated on
keypress to IRB, for example just press '\rt' to open an irb session, '\rf'
to send the whole file to irb or '\rd' to send the current 'def..end'
block.

I do not know, but perhaps someone may find this script useful so I decided
to post it here in the news. Just extract the files from

http://www-user.tu-chemnitz.de/~fifr/downloads/vinfruby.tgz

to ~/.vim/plugin. The file 'vinfruby.vim' explains the key-mappings. The
plugin is neighter complete nor pretty well tested, but it works for me.



Hope it may be useful,
Nice, this may become my new favorite toy. Thanks!
 
B

Brian Guthrie

Hi,

my favourite editor for programming is Vim. When editing some ruby-scripts I
usually have an xterm open with a running irb-session. When testing some
code snippets, I copy & paste them to IRB. In Emacs I could evaluate those
snippets in an inferior-ruby session within Emacs. I do not know how to
this in Vim, so I wrote a little vim-plugin called 'vinfruby' to do
something similar.

vinfruby starts an xterm with an IRB session and uses DRb to communicate
with the Vim-plugin. The plugin then sends the code to be evaluated on
keypress to IRB, for example just press '\rt' to open an irb session, '\rf'
to send the whole file to irb or '\rd' to send the current 'def..end'
block.

I do not know, but perhaps someone may find this script useful so I decided
to post it here in the news. Just extract the files from

http://www-user.tu-chemnitz.de/~fifr/downloads/vinfruby.tgz

to ~/.vim/plugin. The file 'vinfruby.vim' explains the key-mappings. The
plugin is neighter complete nor pretty well tested, but it works for me.



Hope it may be useful,

Greetings,

Frank.

Much simpler but not nearly as cool, and I don't know if others do the
same, I have my vim set up to save and run the current file in IRB
when I hit F2 (doesn't work in gvim):

map <F2> :!clear<CR>:w<CR>:!irb -r%<CR>

Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Vim Plugin Issue 2
integrating irb/ruby into vim 2
Ruby in vim throws an error 0
Ruvi, Vim, Ruby 3
Problem with vim and SimpleFold 4
Scripting vim using ruby interface 0
irb in cygwin 1
For the vim folks 2

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top