Prezto: Ctrl + R history search

Created on 28 May 2014  路  7Comments  路  Source: sorin-ionescu/prezto

The history reverse search that I have used for year with zsh doesn't seem to work when I use prezto, do I need to do something funny here?

Discussion Duplicate

Most helpful comment

after commenting out vi keybindings in .zpreztorc it started working for me:

# zstyle ':prezto:module:editor' key-bindings 'vi'

All 7 comments

Tom, not long ago someone else had a similar issue. It turned out that
his environment had Ctrl + R assigned to another function.
Sorin suggested to run bindkey -L to list all keybindings in your
environment.
You can further simplify by running:
bindkey -L | grep -i "\^r"
That will filter for any bindkey that contains Ctrl + R
Hope this helps.

Somehow its bound to redisplay, which is odd because by default zsh binds ctrl+r to history search

If I run zsh without any special .zshrc config I get...

bindkey -L | grep "\^R"
bindkey "^R" history-incremental-search-backward

So why would prezto decide to change that to redisplay?

Edit:

I think I figured out what the deal was, its because for the first time ever I was using the vi line editing keybindings (which I've always been meaning to use) and that appears to change the zsh ctrl+r binding.

I am not sure why this happens for some users, I am not very experienced
with bash so I don't know how to continue "debug" to locate the origin
of this issue. Perhaps Sorin might share some advice as it maybe be
useful to include in the documentation.

Duplicate of #596.

after commenting out vi keybindings in .zpreztorc it started working for me:

# zstyle ':prezto:module:editor' key-bindings 'vi'

You can change vi to emacs.

This is where it is overrided in favor of redo.
I will rebind it back to the original since I don't use redo a lot and typing ? in normal mode is kind of a pain apparently.
https://github.com/sorin-ionescu/prezto/blob/master/modules/editor/init.zsh#L271

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hiqua picture hiqua  路  6Comments

jeffwidman picture jeffwidman  路  3Comments

brycekellogg picture brycekellogg  路  4Comments

gdetrez picture gdetrez  路  5Comments

adrian-amaglio picture adrian-amaglio  路  5Comments