watch this  

the official mrchucho blog

Leopard: readline and vi bindings

Posted 2007 Nov 06

After upgrading to Leopard and reading about how readline support was included for irb (among other things), I was frustrated to find that my vi bindings were not working. vi bindings worked fine for bash, but irb, python, mysql, etc. reverted to the default emacs bindings. Well, it turns out that Leopard actually uses libedit, a “non-GPL replacement for readline library”.

Apparently, libedit uses .editrc instead of .inputrc and has a different syntax. So, in order to get vi bindings in Leopard, create the file .editrc with the following contents: bind -v

Responses to "Leopard: readline and vi bindings"

Tammer Saleh

2007 Dec 07 at 19:14

I’ve been trying to fix this for about a month now. Thank you very much for this post.

Tony Kay

2008 Jan 18 at 02:47

I was also affected by this. Thank you very much for your post.

James Kyle

2008 Feb 25 at 14:56

Yes, thank you. This has been quite frustrating.

Matt Foster

2008 Mar 20 at 12:05

Thanks for this info..

It appears that this library is also known as editline, and that’s what the man pages are called. Particular handy is:
man editrc

John Hyland

2008 Jul 06 at 12:14

Thanks, man. That was driving me crazy.

Philip Garrett

2008 Oct 25 at 15:50

mrchucho++ My thanks, too.


2009 Jul 20 at 11:34

Thanks a million. Just got a mac, and couldn’t figure out how to get vi in mysql commandline. You saved my day.

Comments are now closed.
atom rss