bash: per-command history. How does it work?

Add the following to ~/.inputrc:

"\e[B": history-search-forward
"\e[A": history-search-backward

I've used this for quite a while now, therefore unfortunately I cannot credit the source.