0

In bash, we can use the up and down arrow keys to get the last or nth previous command in history.

Can we do this in zsh?

1

According to man zshzle you should be able to

  • ctrl+n next history
  • ctrl+p previous history

man zshzle:

down-history (unbound) (^N) (unbound)
       Move to the next event in the history list

up-history (unbound) (^P) (unbound)
       Move to the previous event in the history list.

Oh-my-zsh

Also, not sure if you know already, but there is also oh-my-zsh. This customization of zsh does come with down/up as well as previously mentioned ctrl+n/ctrl+p for next/previous in history list, respectively

| improve this answer | |

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