summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKyle West <kswest@gmail.com>2012-01-30 23:04:06 -0500
committerFelix Dreissig <f30@f30.me>2012-10-13 23:44:31 +0200
commitf7708d4181374cfbd223e071f7253018f28e5509 (patch)
tree2ac43890dcf4aec87c8024265463199a57e2b17c /lib
parent68cec79d32baeb96efc357ba94c0bfe5b4059c90 (diff)
downloadzsh-f7708d4181374cfbd223e071f7253018f28e5509.tar.gz
zsh-f7708d4181374cfbd223e071f7253018f28e5509.tar.bz2
zsh-f7708d4181374cfbd223e071f7253018f28e5509.zip
forgot to save before committing. doh
Diffstat (limited to 'lib')
-rw-r--r--lib/key-bindings.zsh54
1 files changed, 54 insertions, 0 deletions
diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh
index e69de29bb..195bbb38e 100644
--- a/lib/key-bindings.zsh
+++ b/lib/key-bindings.zsh
@@ -0,0 +1,54 @@
+# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
+# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins
+# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets
+
+bindkey -e # Use emacs key bindings
+
+bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark
+bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls
+bindkey -s '\e.' '..\n' # [Esc-.] - run command: .. (up directory)
+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.
+bindkey '^[[5~' up-line-or-history # [PageUp] - Up a line of history
+bindkey '^[[6~' down-line-or-history # [PageDown] - Down a line of history
+
+bindkey '^[[A' up-line-or-search # start typing + [Up-Arrow] - fuzzy find history forward
+bindkey '^[[B' down-line-or-search # start typing + [Down-Arrow] - fuzzy find history backward
+
+bindkey '^[[H' beginning-of-line # [Home] - Go to beginning of line
+bindkey '^[[1~' beginning-of-line # [Home] - Go to beginning of line
+bindkey '^[OH' beginning-of-line # [Home] - Go to beginning of line
+bindkey '^[[F' end-of-line # [End] - Go to end of line
+bindkey '^[[4~' end-of-line # [End] - Go to end of line
+bindkey '^[OF' end-of-line # [End] - Go to end of line
+
+bindkey ' ' magic-space # [Space] - do history expansion
+
+bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word
+bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word
+
+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.
+
+# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~
+bindkey '^?' backward-delete-char # [Delete] - delete backward
+bindkey '^[[3~' delete-char # [fn-Delete] - delete forward
+bindkey '^[3;5~' delete-char # [TODO] - delete forward
+bindkey '\e[3~' delete-char # [TODO] - delete forward
+
+# 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'
+#