Skip to content

Instantly share code, notes, and snippets.

@agargiulo
Created June 28, 2013 03:45
Show Gist options
  • Save agargiulo/5882336 to your computer and use it in GitHub Desktop.
Save agargiulo/5882336 to your computer and use it in GitHub Desktop.
ZKBD_FILE=${HOME}/.zkbd/$TERM-$VENDOR-$OSTYPE
if [[ -e $ZKBD_FILE ]]
then
source $ZKBD_FILE
else
autoload zkbd
zkbd
source $ZKBD_FILE
fi
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode
[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
autoload -U up-line-or-beginning-search
zle -N up-line-or-beginning-search
[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N down-line-or-beginning-search
[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-beginning-search
[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char
[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment