zsh ctrl p same behavior as up arrow
By default Ctrl-P just jump back to the history while up arrow behave a little bit smarter.
For example if you have history like this
1
ssh a.com
2
ls
3
cd
4
ssh b.com
5
cat
6
grep
Copied!
Normaly if you type $ ssh and Ctrl-P afterwares, it will give you grep not ssh b.com
to change this behavior, you can put this in your .zshrc
1
bindkey "^P" up-line-or-beginning-search
2
bindkey "^N" down-line-or-beginning-search
Copied!
Last modified 1mo ago
Copy link