From: Simon Ruderich Date: Tue, 11 Feb 2014 01:34:52 +0000 (+0100) Subject: zsh/rc: Map incremental search to Ctrl-R. X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=commitdiff_plain;h=861dc978760ca60aced1dc14dea0ac72c01f002b zsh/rc: Map incremental search to Ctrl-R. It's not mapped per default in Vi-mode. --- 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.