dotfiles/homedir/.config/zsh.d/modules/keys
fbt c78cb78ff0 init
Signed-off-by: fbt <fbt@fleshless.org>
2017-05-03 16:10:13 +03:00

29 lines
517 B
Bash

# 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