key-bindings.zsh 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
  2. # http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins
  3. # http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets
  4. bindkey -e # Use emacs key bindings
  5. bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark
  6. bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls
  7. bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line.
  8. bindkey '^[[5~' up-line-or-history # [PageUp] - Up a line of history
  9. bindkey '^[[6~' down-line-or-history # [PageDown] - Down a line of history
  10. bindkey '^[[A' up-line-or-search # start typing + [Up-Arrow] - fuzzy find history forward
  11. bindkey '^[[B' down-line-or-search # start typing + [Down-Arrow] - fuzzy find history backward
  12. bindkey '^[[H' beginning-of-line # [Home] - Go to beginning of line
  13. bindkey '^[[1~' beginning-of-line # [Home] - Go to beginning of line
  14. bindkey '^[OH' beginning-of-line # [Home] - Go to beginning of line
  15. bindkey '^[[F' end-of-line # [End] - Go to end of line
  16. bindkey '^[[4~' end-of-line # [End] - Go to end of line
  17. bindkey '^[OF' end-of-line # [End] - Go to end of line
  18. bindkey ' ' magic-space # [Space] - do history expansion
  19. bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word
  20. bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word
  21. bindkey '^[[Z' reverse-menu-complete # [TODO] - Perform menu completion, like menu-complete, except that if a menu completion is already in progress, move to the previous completion rather than the next.
  22. # Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~
  23. bindkey '^?' backward-delete-char # [Delete] - delete backward
  24. bindkey '^[[3~' delete-char # [fn-Delete] - delete forward
  25. bindkey '^[3;5~' delete-char # [TODO] - delete forward
  26. bindkey '\e[3~' delete-char # [TODO] - delete forward
  27. # consider emacs keybindings:
  28. #bindkey -e ## emacs key bindings
  29. #
  30. #bindkey '^[[A' up-line-or-search
  31. #bindkey '^[[B' down-line-or-search
  32. #bindkey '^[^[[C' emacs-forward-word
  33. #bindkey '^[^[[D' emacs-backward-word
  34. #
  35. #bindkey -s '^X^Z' '%-^M'
  36. #bindkey '^[e' expand-cmd-path
  37. #bindkey '^[^I' reverse-menu-complete
  38. #bindkey '^X^N' accept-and-infer-next-history
  39. #bindkey '^W' kill-region
  40. #bindkey '^I' complete-word
  41. ## Fix weird sequence that rxvt produces
  42. #bindkey -s '^[[Z' '\t'
  43. #