# 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