1 autoload -U history-search-end
2 zle -N history-beginning-search-backward-end history-search-end
3 zle -N history-beginning-search-forward-end history-search-end
4 bindkey "^[[A" history-beginning-search-backward-end
5 bindkey "^[[B" history-beginning-search-forward-end
7 beginning-history-incremental-pattern-search-backward() {
8 zle history-incremental-pattern-search-backward ${BUFFER:gs/ /*/}
10 zle -N beginning-history-incremental-pattern-search-backward
11 bindkey "^[[1;2A" beginning-history-incremental-pattern-search-backward
12 bindkey -M isearch "^[[A" history-incremental-pattern-search-backward
13 bindkey -M isearch "^[[B" history-incremental-pattern-search-forward