key-bindings.zsh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # TODO: Explain what some of this does..
  2. bindkey -e
  3. bindkey '\ew' kill-region
  4. bindkey -s '\el' "ls\n"
  5. bindkey '^r' history-incremental-search-backward
  6. bindkey "^[[5~" up-line-or-history
  7. bindkey "^[[6~" down-line-or-history
  8. # make search up and down work, so partially type and hit up/down to find relevant stuff
  9. bindkey '^[[A' up-line-or-search
  10. bindkey '^[[B' down-line-or-search
  11. bindkey "^[[H" beginning-of-line
  12. bindkey "^[[1~" beginning-of-line
  13. bindkey "^[OH" beginning-of-line
  14. bindkey "^[[F" end-of-line
  15. bindkey "^[[4~" end-of-line
  16. bindkey "^[OF" end-of-line
  17. bindkey ' ' magic-space # also do history expansion on space
  18. bindkey "^[[1;5C" forward-word
  19. bindkey "^[[1;5D" backward-word
  20. bindkey '^[[Z' reverse-menu-complete
  21. # Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~
  22. bindkey '^?' backward-delete-char
  23. bindkey "^[[3~" delete-char
  24. bindkey "^[3;5~" delete-char
  25. bindkey "\e[3~" delete-char
  26. # Edit the current command line in $EDITOR
  27. autoload -U edit-command-line
  28. zle -N edit-command-line
  29. bindkey '\C-x\C-e' edit-command-line
  30. # consider emacs keybindings:
  31. #bindkey -e ## emacs key bindings
  32. #
  33. #bindkey '^[[A' up-line-or-search
  34. #bindkey '^[[B' down-line-or-search
  35. #bindkey '^[^[[C' emacs-forward-word
  36. #bindkey '^[^[[D' emacs-backward-word
  37. #
  38. #bindkey -s '^X^Z' '%-^M'
  39. #bindkey '^[e' expand-cmd-path
  40. #bindkey '^[^I' reverse-menu-complete
  41. #bindkey '^X^N' accept-and-infer-next-history
  42. #bindkey '^W' kill-region
  43. #bindkey '^I' complete-word
  44. ## Fix weird sequence that rxvt produces
  45. #bindkey -s '^[[Z' '\t'
  46. #