From 4feb6907a365f3dd19f246563c17656a7bc22f90 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Thu, 19 Jul 2018 11:06:14 +0200 Subject: [PATCH] zsh/rc: use current input for incremental searches --- shell/zsh/rc | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.45.2