Adding history substring from Robby Russel

to add substring during autocompletion:)