You don't need any script file to check bindkey behaviour.
Just hit keys and binding.
You can reset all bindkeys by bindkey -d
or restart shell ( e.g exec $SHELL
or close window and reopen windows )
bindkey -s A "some string"
Hit capital letter "A" key and some string appears.
bindkey B accept-line
Push B key and Enter happens and.
"accept-line" is zle basic widget.
bindkey
Enter with no arguments.
You will see all bindkey mappings and zle widgets list.
"^@" set-mark-command
"^A" beginning-of-line
"^B" backward-char
"^D" delete-char-or-list
"^E" incremental-select-command-history
...
Defune shell function.
function _hello_zle(){ echo "Hello zle original widget" && zle reset-prompt }
by zle command.
zle -N hello _hello_zle
bindkey C hello
# Push C
Hello zle custom widget!
Overwrite shell function overwrites widget behaviour.
function _hello_zle(){ echo "Umm comfortable zsh" && zle reset-prompt }
# Push C
Umm comfortable zsh
- zsh 5.5.1 (x86_64-apple-darwin17.5.0)