Short Howto: key bindings in shells
July 27, 2007

This short howto explains how to figure out which key binding is connected with which key.
I just read a post about zsh and once again was curious about the possibilities and the advantages of that shell. The author provided a customized .zshrc which I used for tests. And despite the good intentions of the author it was almost unusable.
One reason for that was that the key bindings weren’t right: when I pressed the DEL key a new char “~” appeared instead of another one deleted. POS1 and END keys also just produces more “~” chars. This was due to the fact that the key bindings for the keys were set to the wrong keys: bindkey \'^[OF\' end-of-line simply didn’t work for me.
So I had to figure out the right key binding - this is easily done by calling cat and afterwards press the key which key binding you’d like to have. For me it...