1diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh
2index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..195bbb38e33e08a0e01008fda3ebdd48539bea66 100644
3--- a/lib/key-bindings.zsh
4+++ b/lib/key-bindings.zsh
5@@ -0,0 +1,54 @@
6+# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
7+# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins
8+# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets
9+
10+bindkey -e # Use emacs key bindings
11+
12+bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark
13+bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls
14+bindkey -s '\e.' '..\n' # [Esc-.] - run command: .. (up directory)
15+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.
16+bindkey '^[[5~' up-line-or-history # [PageUp] - Up a line of history
17+bindkey '^[[6~' down-line-or-history # [PageDown] - Down a line of history
18+
19+bindkey '^[[A' up-line-or-search # start typing + [Up-Arrow] - fuzzy find history forward
20+bindkey '^[[B' down-line-or-search # start typing + [Down-Arrow] - fuzzy find history backward
21+
22+bindkey '^[[H' beginning-of-line # [Home] - Go to beginning of line
23+bindkey '^[[1~' beginning-of-line # [Home] - Go to beginning of line
24+bindkey '^[OH' beginning-of-line # [Home] - Go to beginning of line
25+bindkey '^[[F' end-of-line # [End] - Go to end of line
26+bindkey '^[[4~' end-of-line # [End] - Go to end of line
27+bindkey '^[OF' end-of-line # [End] - Go to end of line
28+
29+bindkey ' ' magic-space # [Space] - do history expansion
30+
31+bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word
32+bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word
33+
34+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.
35+
36+# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~
37+bindkey '^?' backward-delete-char # [Delete] - delete backward
38+bindkey '^[[3~' delete-char # [fn-Delete] - delete forward
39+bindkey '^[3;5~' delete-char # [TODO] - delete forward
40+bindkey '\e[3~' delete-char # [TODO] - delete forward
41+
42+# consider emacs keybindings:
43+
44+#bindkey -e ## emacs key bindings
45+#
46+#bindkey '^[[A' up-line-or-search
47+#bindkey '^[[B' down-line-or-search
48+#bindkey '^[^[[C' emacs-forward-word
49+#bindkey '^[^[[D' emacs-backward-word
50+#
51+#bindkey -s '^X^Z' '%-^M'
52+#bindkey '^[e' expand-cmd-path
53+#bindkey '^[^I' reverse-menu-complete
54+#bindkey '^X^N' accept-and-infer-next-history
55+#bindkey '^W' kill-region
56+#bindkey '^I' complete-word
57+## Fix weird sequence that rxvt produces
58+#bindkey -s '^[[Z' '\t'
59+#