Just a question to improve my bash skills. I always do this:
bash
$ history | grep some_long_command ... ... 123 some_long_command1......... 124 some_l
You can get to edit mode by hitting M-^ (option-shift-6 on a mac).
Type this:
!123M-^
And you'll be editing command #123. It's sort of like using ctrl-r, but starting with exclamation-point syntax.