summaryrefslogtreecommitdiff
path: root/.zsh
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2013-12-03 06:51:08 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2013-12-03 06:51:17 +0100
commitd7fb8caa2a6a91cef4cda3f576d3f461f9a37504 (patch)
tree6592633a4fb132f2ad5a6009450fc2a017af6aa9 /.zsh
parentc86931a5d7033ec987d6bde1b0180a1f8c63fd85 (diff)
downloaddotfiles-d7fb8caa2a6a91cef4cda3f576d3f461f9a37504.tar.gz
dotfiles-d7fb8caa2a6a91cef4cda3f576d3f461f9a37504.tar.bz2
dotfiles-d7fb8caa2a6a91cef4cda3f576d3f461f9a37504.zip
zsh: Make up-/down- to only use local history and Ctrl-R/-S to use global
history.
Diffstat (limited to '.zsh')
-rw-r--r--.zsh/zshrc14
1 files changed, 13 insertions, 1 deletions
diff --git a/.zsh/zshrc b/.zsh/zshrc
index 426b6f9..dc7ac2b 100644
--- a/.zsh/zshrc
+++ b/.zsh/zshrc
@@ -226,6 +226,7 @@ _set_cwd
# Key bindings {{{
#################################################
bindkey -e # use emacs style :)
+
if is-at-least 4.3.9; then
bindkey "^R" history-incremental-pattern-search-backward
bindkey "^S" history-incremental-pattern-search-forward
@@ -239,7 +240,6 @@ bindkey "^[-" copy-prev-word
# delete previous word upto next whitespace
bindkey "^ew" backward-kill-word
-
# some 'insert x before' things
for word c in sudo s vim v AK a; do
eval "insert-$word() { LBUFFER=\"$word \$LBUFFER\" }"
@@ -247,6 +247,18 @@ for word c in sudo s vim v AK a; do
bindkey "^[i$c" insert-$word
done
+# use only local history on arrow-up
+# but also imported one when using C-r
+zle-line-init() { NUMERIC=1 zle set-local-history }
+zle -N zle-line-init
+
+zle-isearch-update() { NUMERIC=0 zle set-local-history }
+zle -N zle-isearch-update
+
+zle-isearch-exit() { NUMERIC=1 zle set-local-history }
+zle -N zle-isearch-exit
+
+# fix Del, Pos1, End
case $TERM in
xterm*)
bindkey "^[OH" beginning-of-line