Irb command-line editing

Hi. Can anyone tell me how to get vi-style command-line editing in irb,
please.
Thanks

···

--
The answer's always "Yes".
Now, what was the question?

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---

Graham Nicholls ha scritto:

Hi. Can anyone tell me how to get vi-style command-line editing in irb,
please.
Thanks

I guess you can set up your own inputrc file, since IRB is based on readline, and set "editing-mode" to "vi", I never trtied it, though.

gabriele renzi wrote:

Graham Nicholls ha scritto:

Hi. Can anyone tell me how to get vi-style command-line editing in irb,
please.
Thanks

I guess you can set up your own inputrc file, since IRB is based on
readline, and set "editing-mode" to "vi", I never trtied it, though.

I have a .inputrc with precisely that. ESC-k simply echoes.

I've tried rebuilding from source with:

../configure --with-readline=YES ; make ; make install

,but to no avail.

Is this the right redline option? DO I start irb with a parameter?

Thanks

···

--
The answer's always "Yes".
Now, what was the question?

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---

Graham Nicholls wrote:

gabriele renzi wrote:

Graham Nicholls ha scritto:

Hi. Can anyone tell me how to get vi-style command-line editing in irb,
please.
Thanks

I guess you can set up your own inputrc file, since IRB is based on
readline, and set "editing-mode" to "vi", I never trtied it, though.

I have a .inputrc with precisely that. ESC-k simply echoes.

I've tried rebuilding from source with:

./configure --with-readline=YES ; make ; make install

,but to no avail.

Is this the right redline option? DO I start irb with a parameter?

Thanks

PS Sorry to followup on y own post, but when I strace the irb binary, all
the references to readline produce an ENOENT error. Readline is on the
box, as I use it from bash (unless its built in?)
Not sure if this is relevant.

Heres part of the strace output:

stat("./readline.rb", 0x7fffffffaad0) = -1 ENOENT (No such file or
directory)
stat("./readline.so", 0x7fffffffaad0) = -1 ENOENT (No such file or
directory)

Graham

···

--
The answer's always "Yes".
Now, what was the question?

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---

* Graham Nicholls <graham@rockcons.co.uk> [0459 15:59]:

Graham Nicholls wrote:

> gabriele renzi wrote:
>
>> Graham Nicholls ha scritto:
>>> Hi. Can anyone tell me how to get vi-style command-line editing in irb,
>>> please.
>>> Thanks
>>
>> I guess you can set up your own inputrc file, since IRB is based on
>> readline, and set "editing-mode" to "vi", I never trtied it, though.
> I have a .inputrc with precisely that. ESC-k simply echoes.
>
> I've tried rebuilding from source with:
>
> ./configure --with-readline=YES ; make ; make install
>
> ,but to no avail.
>
> Is this the right redline option? DO I start irb with a parameter?
>
> Thanks
PS Sorry to followup on y own post, but when I strace the irb binary, all
the references to readline produce an ENOENT error. Readline is on the
box, as I use it from bash (unless its built in?)
Not sure if this is relevant.

Heres part of the strace output:

stat("./readline.rb", 0x7fffffffaad0) = -1 ENOENT (No such file or
directory)
stat("./readline.so", 0x7fffffffaad0) = -1 ENOENT (No such file or
directory)

You need the readline extension - you can get it by going
into the ext/readline subdirectory of the source and doing a
'make ; make install' - though you'll need the C readline library installed too.

···

--
'Yeah, life is hilariously cruel.'
    -- Bender
Rasputin :: Jack of All Trades - Master of Nuns

Dick Davies wrote:

* Graham Nicholls <graham@rockcons.co.uk> [0459 15:59]:

Graham Nicholls wrote:

> gabriele renzi wrote:
>
>> Graham Nicholls ha scritto:
>>> Hi. Can anyone tell me how to get vi-style command-line editing in
>>> irb, please.
>>> Thanks
>>
>> I guess you can set up your own inputrc file, since IRB is based on
>> readline, and set "editing-mode" to "vi", I never trtied it, though.
> I have a .inputrc with precisely that. ESC-k simply echoes.
>
> I've tried rebuilding from source with:
>
> ./configure --with-readline=YES ; make ; make install
>
> ,but to no avail.
>
> Is this the right redline option? DO I start irb with a parameter?
>
> Thanks
PS Sorry to followup on y own post, but when I strace the irb binary, all
the references to readline produce an ENOENT error. Readline is on the
box, as I use it from bash (unless its built in?)
Not sure if this is relevant.

Heres part of the strace output:

stat("./readline.rb", 0x7fffffffaad0) = -1 ENOENT (No such file or
directory)
stat("./readline.so", 0x7fffffffaad0) = -1 ENOENT (No such file or
directory)

You need the readline extension - you can get it by going
into the ext/readline subdirectory of the source and doing a
'make ; make install' - though you'll need the C readline library
installed too.

Hmmm. make in the ext/readline directory just says "nothing to do".
The target for all or install is simply the Makefile itself:

all install: Makefile

Which I would guess means that the mf is not built properly - but I'm
confused now. configure at the top level has no reference to readline.

UPDATE: in case anyone is intereted!

Thanks, Dick!

What I had to do was to edit ext/Setup, and uncomment the "#readline" line
(by removing the '#'), then at the top level, make install again, et voila,
irb now has vi-style command line editing (and is now much more useful, for
me at least).

I dare say this is documented, but I was too feeble to find it!

Thanks
Graham Nicholls

···

--
The answer's always "Yes".
Now, what was the question?

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---