# Keys # vim: ft=zsh bindkey -e declare -A key key[Home]=$terminfo[khome] key[End]=$terminfo[kend] key[Delete]=$terminfo[kdch1] declare -A bindings bindings=( Home 'beginning-of-line' End 'end-of-line' Delete 'delete-char' ^R 'history-incremental-search-backward' ) for b in ${(k)bindings}; do if [[ $key[$b] ]]; then bindkey $key[$b] $bindings[$b] fi done function zle-line-init () { echoti smkx; } function zle-line-finish () { echoti rmkx; } zle -N zle-line-init zle -N zle-line-finish