Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vi Mode for redis-cli

I have set editing-mode vi in .inputrc, which affects consoles for Ruby, MySQL, etc. It doesn't work for Redis though and I'm wondering if there's any way to make it so (ideally on OSX and Linux).

(It's mentioned here too.)

like image 414
mahemoff Avatar asked Jul 04 '13 11:07

mahemoff


2 Answers

As @h2ero said redis-cli provides own line editing layer and it doesn't use readline.

Try to use rlwrap:

$ rlwrap -a -- redis-cli 
like image 152
paluh Avatar answered Sep 19 '22 18:09

paluh


I have downloaded redis source code and found redis cli it hadn't used readline library (readline/readline.h). so it can't use key binding.

http://cnswww.cns.cwru.edu/php/chet/readline/readline.html

like image 20
h2ero Avatar answered Sep 22 '22 18:09

h2ero