X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=zsh%2Frc;h=908896121d042ad4f7123c04a9367b7a9c48ae1a;hb=1fca0311a9b2f77e4f48e7dfaec3bee82e13ec97;hp=876bfc785470754268c6317cca4fa7c0cd3a5f98;hpb=c7f5fb40c46b8c99ddc93fbc1df2987e178e0124;p=config%2Fdotfiles.git diff --git a/zsh/rc b/zsh/rc index 876bfc7..9088961 100644 --- 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,13 +837,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 }