From 861dc978760ca60aced1dc14dea0ac72c01f002b Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 11 Feb 2014 02:34:52 +0100 Subject: [PATCH] zsh/rc: Map incremental search to Ctrl-R. It's not mapped per default in Vi-mode. --- zsh/rc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/zsh/rc b/zsh/rc index 9e8edd2..f8adacf 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,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. -- 2.44.1