Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

First of all, I am using zsh and oh-my-zsh with nearly no other customization.

In zsh, when I press up-arrow, it brings me the latest commands. And if I typed some characters before I press up-arrow, it will bring me the latest command starting with those characters. It is quite an useful feature since I issue a lot of git/vim/scp commands alternatively.

But now I am switching to a keyboard without arrow keys, and I tend to use ctrl+p instead of up-arrow for history completion. However, no matter how many characters I typed before press ctrl+p, it will always bring me the latest command (not the latest starting with those characters)

How should I configure the zsh (or oh-my-zsh) to fix this?

share|improve this question

migrated from stackoverflow.com Apr 16 '13 at 15:26

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

2 Answers 2

up vote 4 down vote accepted
bindkey "^P" up-line-or-search
share|improve this answer
    
Thanks a lot! I'll file an issue to oh-my-zsh to add this into its default lib/keybinding.zsh. –  Gordon Gao Apr 17 '13 at 17:25
bindkey -e

This uses emacs keybindings and seems to work for me.

share|improve this answer

Your Answer

 
discard

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

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