lib/key-bindings.zsh
71c59eaf
 # TODO: Explain what some of this does..
93af38f1
 
ff26f3c9
 bindkey -v
71c59eaf
 bindkey '\ew' kill-region
802d42a4
 
 # ^j ^i ^m ^, ^. cannot be used
 alias ←="pushd -q +1"
 alias →="pushd -q -0"
 alias ↑="cd .."
 bindkey -s '^u' "↑\n"
 bindkey -s '^b' "←\n"
 bindkey -s '^f' "→\n"
 
71c59eaf
 bindkey '^r' history-incremental-search-backward
 bindkey "^[[5~" up-line-or-history
 bindkey "^[[6~" down-line-or-history
b6d77820
 
 # make search up and down work, so partially type and hit up/down to find relevant stuff
 bindkey '^[[A' up-line-or-search
 bindkey '^[[B' down-line-or-search
 
71c59eaf
 bindkey "^[[H" beginning-of-line
 bindkey "^[[1~" beginning-of-line
428f18cf
 bindkey "^[OH" beginning-of-line
71c59eaf
 bindkey "^[[F"  end-of-line
 bindkey "^[[4~" end-of-line
428f18cf
 bindkey "^[OF" end-of-line
89d86d86
 bindkey ' ' magic-space    # also do history expansion on space
 
428f18cf
 bindkey "^[[1;5C" forward-word
 bindkey "^[[1;5D" backward-word
 
3e1d5fa3
 bindkey '^[[Z' reverse-menu-complete
89d86d86
 
c7c959de
 # Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~
eb63ddf6
 bindkey '^?' backward-delete-char
c7c959de
 bindkey "^[[3~" delete-char
 bindkey "^[3;5~" delete-char
7d9628b2
 bindkey "\e[3~" delete-char
c7c959de
 
89d86d86
 # consider emacs keybindings:
 
 #bindkey -e  ## emacs key bindings
 #
 #bindkey '^[[A' up-line-or-search
 #bindkey '^[[B' down-line-or-search
 #bindkey '^[^[[C' emacs-forward-word
 #bindkey '^[^[[D' emacs-backward-word
 #
 #bindkey -s '^X^Z' '%-^M'
 #bindkey '^[e' expand-cmd-path
 #bindkey '^[^I' reverse-menu-complete
 #bindkey '^X^N' accept-and-infer-next-history
 #bindkey '^W' kill-region
 #bindkey '^I' complete-word
 ## Fix weird sequence that rxvt produces
 #bindkey -s '^[[Z' '\t'
99d72cad
 #