Say I have the following entries in my command history:
less documents/doc1.txt
less documents/doc2.txt
less files/file1.txt
less files/file2.txt
ls
pwd
and that I have the following keyboard binding enabled:
bindkey '^P' history-search-backward
I have noticed that if I then type:
less documents
^P
ZLE brings
less files/files2.txt
as the first option, rather than:
less documents/doc2.txt
Why is that? Is there a way to make history-search
fix everything on the left of my cursor and iterate through the history with it?