embedding ruby code in a vim function

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

embedding ruby code in a vim function

Matthew Huggett
Hi,

I wonder if someone with some experience with Vim's Ruby interface could
shed some light on this for me:

If I have some Ruby in a Vim function like:
        ,-------------------------
        |function MyFunction(arg)
        | ruby << EOF
        | ... some Ruby stuff ...
        `-------------------------

How can I use that 'arg' within the Ruby stuff?

Thanks,

Matt
Reply | Threaded
Open this post in threaded view
|

Re: embedding ruby code in a vim function

Thomas-4-2
> How can I use that 'arg' within the Ruby stuff?

VIM::evaluate('a:arg')

Cheers,
Thomas.

Reply | Threaded
Open this post in threaded view
|

Re: embedding ruby code in a vim function

Matthew Huggett
That's the ticket.  Thanks a lot.

Matt

Thomas wrote:

>> How can I use that 'arg' within the Ruby stuff?
>
>
> VIM::evaluate('a:arg')
>
> Cheers,
> Thomas.
>
>
>