If I want to bind a key-mapping to a function or widget in zsh I have learnt that I first have to hit Ctrl+v - at a prompt, then enter the key sequence I want to use, then use the output in my key-binding command.So for example if I want to map Ctrl+xCtrl+v to the action of opening the current command line contents in an editor, I need tohit Ctrl+v - to enter dump key modehit Ctrl+xCtrl+vIn my case this produces ^X^Etake the ^X^E and use it in my keybinding command, e.g.bindkey ^X^E edit-command-lineWhy is this necessary and what is actually happening behind the scenes when I do this?
Understanding what is happening when I dump a terminal character sequence with Ctrl-v?
terminal;character encoding;escape characters
When you press Ctrl-V, the shell will start by ignoring keyboard interrupts and simply take the pressed key combination as the input character.  This is easily possible as ASCII is designed to hold all control characters.  Of course, on display it has to cheat a bit and show the ^ followed by the corresponding key or otherwise it would output control characters instead of what you need to see.Note that the bindkey documentation shows that it supports two notations for control characters: (examples refer to Ctrl-X)caret notation which is to explicitly write the caret (^) followed by the corresponding control character textually (not needing the Ctrl-V method in this question);  example: ^XC- followed by the control character;  example: C-x.  This causes some key combinations to require escaping (even if you don't use it).  You should probably read the whole screen and bindkey manual.