- In bash, pressing
[CTRL]+[r]will open thereverse-i-searchprompt. - 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
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-backwardNote: Add the line to your ~/.zshrc to make it permanent.