Retrieve ruby expression return in vim var

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

Retrieve ruby expression return in vim var

Ni Va
Hi,


How can I retrieve the result of that : ruby p RUBY_VERSION into Vim's var.

Thank you

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Retrieve ruby expression return in vim var

Damien
Hi

Le Fri, Jul 06, 2018 at 12:47:38PM -0700, Ni Va Oa écrit :
>How can I retrieve the result of that : ruby p RUBY_VERSION into Vim's var.

Maybe `Vim::command('let temp = json_decode(%s)' % [var, ...].to_json)` ?

Regards

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Retrieve ruby expression return in vim var

Ni Va
Le samedi 7 juillet 2018 02:03:24 UTC+2, Damien a écrit :
> Hi
>
> Le Fri, Jul 06, 2018 at 12:47:38PM -0700, Ni Va Oa écrit :
> >How can I retrieve the result of that : ruby p RUBY_VERSION into Vim's var.
>
> Maybe `Vim::command('let temp = json_decode(%s)' % [var, ...].to_json)` ?
>
> Regards

if matchstr(execute('ruby p RUBY_VERSION'), '2.5.1') == ''
  echomsg 'It will be good to install ruby'
  finish
endif

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.