Skip to content

Instantly share code, notes, and snippets.

@quicksnap
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quicksnap/9844880 to your computer and use it in GitHub Desktop.
Save quicksnap/9844880 to your computer and use it in GitHub Desktop.
diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh
index 9063c6a..8168c8d 100644
--- a/lib/key-bindings.zsh
+++ b/lib/key-bindings.zsh
@@ -2,67 +2,36 @@
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets
-# Make sure that the terminal is in application mode when zle is active, since
-# only then values from $terminfo are valid
-if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
- function zle-line-init() {
- echoti smkx
- }
- function zle-line-finish() {
- echoti rmkx
- }
- zle -N zle-line-init
- zle -N zle-line-finish
-fi
+bindkey -e # Use emacs key bindings
-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 '^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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment