I have history-search-backward mapped as PageUp.

When I type:

git push <PageUp><PageUp><PageUp>
  1. in Bash it begins to cycle through all history entries beginning with git push
  2. in Zsh it begins to cycle through all history entries beginning with git so it will list entries such git status, git remote update etc. This is not what I want.

How can I have zsh behave like bash? What setopt should I set?

link|improve this question

feedback

1 Answer

up vote 2 down vote accepted
bindkey "^[[5~" history-beginning-search-backward

bindkey "^[[6~" history-beginning-search-forward

This is what I use

link|improve this answer
If you want that the same functionality but with Up and Down arror, replace the binding key "^[[5~" to "^[[A" and "^[[6~" to "^[[B" – Millisami Apr 9 at 7:54
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.