]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - zsh/rc
zsh/rc: Map incremental search to Ctrl-R.
[config/dotfiles.git] / zsh / rc
diff --git a/zsh/rc b/zsh/rc
index 876bfc785470754268c6317cca4fa7c0cd3a5f98..f8adacf317b64b7cde56d1c258c74e47a93dcf2c 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -153,6 +153,7 @@ setopt incappendhistory
 setopt histignoredups
 # Don't add lines starting with a space to the history.
 setopt histignorespace
+
 # Vim like completions of previous executed commands (also enter Vi-mode). If
 # called at the beginning it just recalls old commands (like cursor up), if
 # called after typing something, only lines starting with the typed text are
@@ -181,6 +182,14 @@ bindkey -a '^P' history-beginning-search-backward # binding for Vi-mode
 # after calling ^P.
 bindkey -a '^N' history-beginning-search-forward
 
+# Enable incremental search which is especially useful when the string is an
+# argument and not the command.
+bindkey '^R' history-incremental-search-backward
+# Also enable my usual use of Ctrl-P/Ctrl-N to get the previous/next matching
+# history entry.
+bindkey -M isearch '^P' history-incremental-search-backward
+bindkey -M isearch '^N' history-incremental-search-forward
+
 # Automatically push cd-ed directories on the directory stack.
 setopt autopushd
 # Don't push duplicates on the directory stack.
@@ -826,13 +835,9 @@ elif (( $+commands[zathura] )); then
     compdef _xpdf pdf
 fi
 
-# GHCI doesn't use readline, force it if rlwrap is available.
-(( $+commands[rlwrap] )) && ghci() {
-    command rlwrap \
-        --always-readline --complete-filenames -t dumb \
-        --histsize 5000 \
-        --file ~/.shell/rlwrap/ghci \
-        ghci "$@" 2>&1
+# Better viewer for info pages .. just pipe everything into less.
+info() {
+    command info "$@" 2>/dev/null | less
 }