I'm looking for a setting that will make it so that when i hit the up arrow, zsh shows commands i have recently edited. The catch is, i only want unique commands. Currently, if i type echo "hello world"
50 times, i have to press up arrow 50 times to get the command i used before typing the echo command. This is annoying to say the least.
Any thoughts on what setting i need to enable/disable?
Best Answer
HIST_IGNORE_ALL_DUPS
will throw out all previous matches of the command, which can be confusing when using the history as a log of what you did later:A closer fit to your needs is probably the
HIST_FIND_NO_DUPS
option:Or maybe the
HIST_IGNORE_DUPS
, but, as RichieHH notes, it also leads to an incomplete account of history:See:
man zshoptions | less -p History
.