Add the following line to your .zshrc

export HISTCONTROL=ignoreboth:erasedups