X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=blobdiff_plain;f=shell%2Fzsh%2Frc;fp=shell%2Fzsh%2Frc;h=99e46af4cee67038b5aba1129637b555fca12e06;hp=0af99afb89db0be411dbaab526d462c16d5d6e08;hb=4feb6907a365f3dd19f246563c17656a7bc22f90;hpb=3836e3323c3b962087a2790b7ad4d026dd546a76 diff --git a/shell/zsh/rc b/shell/zsh/rc index 0af99af..99e46af 100644 --- a/shell/zsh/rc +++ b/shell/zsh/rc @@ -184,6 +184,13 @@ bindkey -a '^P' history-beginning-search-backward # binding for Vi-mode # after calling ^P. bindkey -a '^N' history-beginning-search-forward +# Use current input when pressing Ctrl-R. Thanks to Mikachu in #zsh on +# Freenode (2016-07-08 20:54 CEST). +zshrc-history-incremental-pattern-search-backward() { + zle .history-incremental-pattern-search-backward $BUFFER +} +zle -N history-incremental-pattern-search-backward \ + zshrc-history-incremental-pattern-search-backward # Enable incremental search which is especially useful when the string is an # argument and not the command. bindkey '^R' history-incremental-pattern-search-backward