20090504

For editline, don't bind jj to vi-command-mode!

I've hesitated posting my version of vicle because I was having what I thought was a weird bug. Somehow, only things with "j" in them were not working. It seemed like "j" and the next character were always omitted from the input to ghci. Finally it occurred to me to try sending the output to bash rather than ghci, and suddenly there was no problem. So the problem was in ghci. Then I remembered that I had done some things in .ghci and .editrc. The latter is where I found I had a line "bind jj vim-command-mode". That turned out to be really bad choice.

And here's where I got that from:
bind -v
bind \\t rl_complete
bind ^L ed-clear-screen
bind jj vi-command-mode <<<--- DON'T DO THIS!!! Esc is good enough! Remap the Windows key or CapsLock to Esc if necessary.

http://www.nabble.com/example-editrc-td21152004.html

I'm grateful to Brian for that message, because it showed me how to get vi bindings in ghci. However, that jj line cost me at least a couple of hours! That's a lesson to myself not to blindly copy and paste without understanding what I'm copying and pasting.

*slaps self upside the head*


Now I can finish cleaning up my version of vicle and post it.

No comments: