zsh: What does hist_find_no_dups mean?
HIST_FIND_NO_DUPS When searching for history entries in the line editor, do not display duplicates of a line previously found, even if the duplicates are not contiguous.
However, when I use Ctrl-p repeatedly, same command appears.
$ ls
$ pwd
$ ls
$ <Ctrl-p> => ls
<Ctrl-p> => pwd
<Ctrl-p> => ls again!
zsh 5.0.5 (x86_64-apple-darwin14.0)
hist_find_no_dups
doesn't guarantee that all lines will by unique, you might be searching back through repeated pair of lines.
If you don't want to have duplicate lines then look into hist_ignore_all_dups
. It will stop repeated commands from appearing in your history file but it might introduce unexpected gaps - something to be aware of if you're reusing parts of your history.
Another option to look into is hist_ignore_dups
. This prevents consecutive duplicates from being saved.
Last, but not least, there's hist_save_no_dups
(ignores duplicates when writing history file) and hist_expire_dups_first
, which will start removing repeating commands when limit of $HISTSIZE
will be reached.