Turn on history substring search.
Turn on COMPLETE_IN_WORD
Bind keys to history substring search.