Scripting vim using ruby interface

I know this should be posted to the vim mailing list, but I wasn’t able
subscribe to it, so I’m posting here instead.

I’ve been trying to write a vim script using vim’s ruby interface, but I
coming across weird errors in completely unexpected places. A very
example is the following: I give the following command (all in one line,

:ruby require ‘pathname’;’/home/stefano/Desktop/test_tools/’).realpath

This command, which works perfectly when executed in irb or using ruby
-e or
from a ruby script, when called from vim gives an error:

SystemStackError: /usr/lib/ruby/1.8/pathname.rb:266:in `chop_basename’:
level too deep.

Moreover, these errors seem random: I can run a piece of code once and
works; i run it again later and it gives an error like the above one
always a SystemStackError). Yet, every time this happens, it’s always in
same position.

Does anyone know if there’s a reason for this behaviour, such as some
kind of
restriction to the ruby code you can call in ruby? Has anyone succeeded
using ruby interface? I’ve searched google, the vim mailing list and vim
documentation, but I found nothing.

Thanks in advance


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs