When I enter in vi mode with set -o vi, I enter in command mode, and I touch the key ? it produces a / and the reverse. Is it normal? How can I change this behavior?

  • 1
    Weird. For me, / produces / and ? produces ?, as expected. I use it all the time! Some sort of shell option? Note that / searches for earlier history entries, which is sort of backwards if you visualize history entries listed in chronological order on successive lines but I think it turns out to be intuitive. All of the this applies equally to zsh, bash, and ksh. – Celada Aug 4 '15 at 1:13

I added those keys :

bindkey -M vicmd '?' history-incremental-search-backward
bindkey -M vicmd '/' history-incremental-search-forward

I do as CTRL+R in emacs mode and I prefer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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