|
|
|
@ -28,33 +28,35 @@ WORDCHARS='*?_-.[]~&;!#$%^(){}<>'
|
|
|
|
|
zmodload zsh/terminfo
|
|
|
|
|
typeset -gA key_info
|
|
|
|
|
key_info=(
|
|
|
|
|
'Control' '\C-'
|
|
|
|
|
'Escape' '\e'
|
|
|
|
|
'Meta' '\M-'
|
|
|
|
|
'Backspace' "^?"
|
|
|
|
|
'Delete' "^[[3~"
|
|
|
|
|
'F1' "$terminfo[kf1]"
|
|
|
|
|
'F2' "$terminfo[kf2]"
|
|
|
|
|
'F3' "$terminfo[kf3]"
|
|
|
|
|
'F4' "$terminfo[kf4]"
|
|
|
|
|
'F5' "$terminfo[kf5]"
|
|
|
|
|
'F6' "$terminfo[kf6]"
|
|
|
|
|
'F7' "$terminfo[kf7]"
|
|
|
|
|
'F8' "$terminfo[kf8]"
|
|
|
|
|
'F9' "$terminfo[kf9]"
|
|
|
|
|
'F10' "$terminfo[kf10]"
|
|
|
|
|
'F11' "$terminfo[kf11]"
|
|
|
|
|
'F12' "$terminfo[kf12]"
|
|
|
|
|
'Insert' "$terminfo[kich1]"
|
|
|
|
|
'Home' "$terminfo[khome]"
|
|
|
|
|
'PageUp' "$terminfo[kpp]"
|
|
|
|
|
'End' "$terminfo[kend]"
|
|
|
|
|
'PageDown' "$terminfo[knp]"
|
|
|
|
|
'Up' "$terminfo[kcuu1]"
|
|
|
|
|
'Left' "$terminfo[kcub1]"
|
|
|
|
|
'Down' "$terminfo[kcud1]"
|
|
|
|
|
'Right' "$terminfo[kcuf1]"
|
|
|
|
|
'BackTab' "$terminfo[kcbt]"
|
|
|
|
|
'Control' '\C-'
|
|
|
|
|
'ControlLeft' '\e[1;5D \e[5D \e\e[D \eOd'
|
|
|
|
|
'ControlRight' '\e[1;5C \e[5C \e\e[C \eOc'
|
|
|
|
|
'Escape' '\e'
|
|
|
|
|
'Meta' '\M-'
|
|
|
|
|
'Backspace' "^?"
|
|
|
|
|
'Delete' "^[[3~"
|
|
|
|
|
'F1' "$terminfo[kf1]"
|
|
|
|
|
'F2' "$terminfo[kf2]"
|
|
|
|
|
'F3' "$terminfo[kf3]"
|
|
|
|
|
'F4' "$terminfo[kf4]"
|
|
|
|
|
'F5' "$terminfo[kf5]"
|
|
|
|
|
'F6' "$terminfo[kf6]"
|
|
|
|
|
'F7' "$terminfo[kf7]"
|
|
|
|
|
'F8' "$terminfo[kf8]"
|
|
|
|
|
'F9' "$terminfo[kf9]"
|
|
|
|
|
'F10' "$terminfo[kf10]"
|
|
|
|
|
'F11' "$terminfo[kf11]"
|
|
|
|
|
'F12' "$terminfo[kf12]"
|
|
|
|
|
'Insert' "$terminfo[kich1]"
|
|
|
|
|
'Home' "$terminfo[khome]"
|
|
|
|
|
'PageUp' "$terminfo[kpp]"
|
|
|
|
|
'End' "$terminfo[kend]"
|
|
|
|
|
'PageDown' "$terminfo[knp]"
|
|
|
|
|
'Up' "$terminfo[kcuu1]"
|
|
|
|
|
'Left' "$terminfo[kcub1]"
|
|
|
|
|
'Down' "$terminfo[kcud1]"
|
|
|
|
|
'Right' "$terminfo[kcuf1]"
|
|
|
|
|
'BackTab' "$terminfo[kcbt]"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Set empty $key_info values to an invalid UTF-8 sequence to induce silent
|
|
|
|
@ -206,10 +208,10 @@ bindkey -d
|
|
|
|
|
# Emacs Key Bindings
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
for key ("$key_info[Escape]"{B,b}) bindkey -M emacs "$key" emacs-backward-word
|
|
|
|
|
for key ("$key_info[Escape]"{F,f}) bindkey -M emacs "$key" emacs-forward-word
|
|
|
|
|
bindkey -M emacs "$key_info[Escape]$key_info[Left]" emacs-backward-word
|
|
|
|
|
bindkey -M emacs "$key_info[Escape]$key_info[Right]" emacs-forward-word
|
|
|
|
|
for key in "$key_info[Escape]"{B,b} "${(s: :)key_info[ControlLeft]}"
|
|
|
|
|
bindkey -M emacs "$key" emacs-backward-word
|
|
|
|
|
for key in "$key_info[Escape]"{F,f} "${(s: :)key_info[ControlRight]}"
|
|
|
|
|
bindkey -M emacs "$key" emacs-forward-word
|
|
|
|
|
|
|
|
|
|
# Kill to the beginning of the line.
|
|
|
|
|
for key in "$key_info[Escape]"{K,k}
|
|
|
|
|