Você pode usar !-2 :
$ echo foo
foo
$ echo bar
bar
$ !-2
echo foo
foo
Isso pode não ajudar com sua situação da mão direita.
Você também pode usar o !string histórico que está pesquisando esse tipo de caso:
$ python test.py
$ vim test.py
$ !py
python test.py # Printed, then run
Isso pode ser mais conveniente de usar. Ele será executado:
the most recent command preceding the current position in the history list starting with string.
Mesmo apenas !p funcionaria. Você pode usar !?string para pesquisar toda a linha de comando, em vez de apenas iniciar.