Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I first switched to ZSH when I would use the up arrow key to move through history it would filter the history based on what I had already typed so if I type mysql and then up I would be stepping through recent commands that started with mysql.

This is no longer the case, now if I use up it just steps thought the most recent commands regardless of what I've already typed. How can I turn this back on?

My .zshrc is very small and I've already tried turning all my options off.

Here is what is in my .zshrc

plugins=(git command-not-found svn debian screen vi-mode)
source $ZSH/

bindkey -v
bindkey "^R" history-incremental-search-backward
export EDITOR="vim"

# history stuff
share|improve this question

migrated from Apr 19 '13 at 15:18

This question came from our site for professional and enthusiast programmers.

"My .zshrc is very small" except that whole oh-my-zsh bit... – jcm Jun 7 '14 at 22:44
up vote 5 down vote accepted

You had up-line-or-search bound to your up-arrow. This should do what you want:

bindkey '^[[A' up-line-or-search
bindkey '^[[B' down-line-or-search


The command above only uses the first word to search. The following will use the whole line. See man zshcontrib...

autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "^[[A" up-line-or-beginning-search # Up
bindkey "^[[B" down-line-or-beginning-search # Down
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.