5
  • In bash, pressing [CTRL]+[r] will open the reverse-i-search prompt.
  • How can I search the zsh history in a similar way?

Note: The search query will hit the middle of the full command only, instead of match at it's beginning as required by the normal zsh search.

1 Answer 1

5

To make zsh behave like bash when pressing [CTRL]+[r]:

# for non-pattern search like in bash 
bindkey "^R" history-incremental-search-backward`

or

# for pattern search (the wildcard `*` will use zsh completion)
bindkey "^R" history-incremental-pattern-search-backward

Note: Add the line to your ~/.zshrc to make it permanent.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .