]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - zsh/rc
zsh/rc: check for isearch keymap
[config/dotfiles.git] / zsh / rc
diff --git a/zsh/rc b/zsh/rc
index 09264ed39e0588f4aac8a732bfc6ad190726cb8d..908896121d042ad4f7123c04a9367b7a9c48ae1a 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,16 @@ 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.
+if [[ $ZSH_VERSION == (4.<4->*|<5->*) ]]; then
+    bindkey -M isearch '^P' history-incremental-search-backward
+    bindkey -M isearch '^N' history-incremental-search-forward
+fi
+
 # Automatically push cd-ed directories on the directory stack.
 setopt autopushd
 # Don't push duplicates on the directory stack.
@@ -826,6 +837,11 @@ elif (( $+commands[zathura] )); then
     compdef _xpdf pdf
 fi
 
+# Better viewer for info pages .. just pipe everything into less.
+info() {
+    command info "$@" 2>/dev/null | less
+}
+
 
 # OS SPECIFIC SETTINGS