bindkey -v bindkey '^N' history-search-forward bindkey '^P' history-search-backward bindkey ' ' magic-space # also do history expansion on space bindkey -s '^[l' '^Qls ' # show dir content bindkey -s '^Z' '^Qfg ' # fg with ^Z bindkey '^[[Z' reverse-menu-complete bindkey -M vicmd 'v' edit-command-line # delay after ESC (in 0.01s) export KEYTIMEOUT=40 # fix Home/End keys bindkey '^[[7~' beginning-of-line bindkey '^[[8~' end-of-line # emacs bindings bindkey '^A' beginning-of-line bindkey '^B' backward-char bindkey '^E' end-of-line bindkey '^F' edit-command-line bindkey '^G' list-expand bindkey '^O' accept-line-and-down-history bindkey '^Q' push-input bindkey '^?' backward-delete-char bindkey '^H' backward-delete-char bindkey '^W' backward-kill-word bindkey '^X=' what-cursor-position bindkey '^[.' insert-last-word bindkey '^[?' which-command bindkey '^[A' accept-and-hold bindkey '^[a' accept-and-hold bindkey '^[C' capitalize-word bindkey '^[c' capitalize-word bindkey '^[H' run-help bindkey '^[h' run-help bindkey '^[T' transpose-words bindkey '^[t' transpose-words # make search up and down work, so partially type and hit up/down to find relevant stuff bindkey '^[[A' up-line-or-search # up arrow bindkey '^[[B' down-line-or-search # down arrow bindkey '^[[5~' up-line-or-history # PgUp bindkey '^[[6~' down-line-or-history # PgDown bindkey '^[OA' up-line-or-history bindkey '^[OB' down-line-or-history bindkey '^[OC' forward-char bindkey '^[OD' backward-char bindkey '^[OF' end-of-line bindkey '^[OH' beginning-of-line bindkey '' forward-word bindkey '' backward-word # Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~ bindkey '^?' backward-delete-char bindkey '^[[3~' delete-char bindkey '^[3;5~' delete-char bindkey '\e[3~' delete-char