dotfiles/homedir/.config/zsh.d/modules/keys

28 lines
471 B
Plaintext
Raw Normal View History

# 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'
)
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