Today I Learned

Skip duplicate history entries in zsh

In zsh, pressing UP searches through the history and brings up all matching commands, even if they are duplicates. That means, sometimes you need to press UP many times to actually find a previous match.

However, it is possible to disable this behaviour and skip duplicate entries from the history. To do that, add one line to your ~/.zshrc: