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
# 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.