From 15043a65915bcc16ad207d65b202659e4988066b Mon Sep 17 00:00:00 2001 From: Lena Fuhrimann <6780471+cloudlena@users.noreply.github.com> Date: Fri, 4 Aug 2023 12:12:57 +0200 Subject: [PATCH] zsh: Add `zsh.history.ignoreAllDups` config option (#4248) --- modules/programs/zsh.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index 94f2a392..58f700df 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -79,6 +79,16 @@ let ''; }; + ignoreAllDups = mkOption { + type = types.bool; + default = false; + description = '' + If a new command line being added to the history list + duplicates an older one, the older command is removed + from the list (even if it is not the previous event). + ''; + }; + ignoreSpace = mkOption { type = types.bool; default = true; @@ -588,6 +598,7 @@ in setopt HIST_FCNTL_LOCK ${if cfg.history.ignoreDups then "setopt" else "unsetopt"} HIST_IGNORE_DUPS + ${if cfg.history.ignoreAllDups then "setopt" else "unsetopt"} HIST_IGNORE_ALL_DUPS ${if cfg.history.ignoreSpace then "setopt" else "unsetopt"} HIST_IGNORE_SPACE ${if cfg.history.expireDuplicatesFirst then "setopt" else "unsetopt"} HIST_EXPIRE_DUPS_FIRST ${if cfg.history.share then "setopt" else "unsetopt"} SHARE_HISTORY