diff --git a/modules/zsh.nix b/modules/zsh.nix index dec1f1e..724b52b 100644 --- a/modules/zsh.nix +++ b/modules/zsh.nix @@ -28,9 +28,13 @@ let # Do not record if first char is space. history.ignoreSpace = true; # Share between sessions. + # This implies INC_APPEND_HISTORY which records commands as soon as they are entered, rather than waiting until the shell exits. + # https://zsh.sourceforge.io/Doc/Release/Options.html history.share = true; - # Don't record commands if they match the ignore pattern. - history.ignorePatterns = [ "history *" ]; + # Don't record commands if they match one of the given shell patterns. + # Only in zsh grouping (`(a|b)`) is available: https://thevaluable.dev/zsh-expansion-guide-example/ + # TODO: Somehow HISTORY_IGNORE is missing in my zsh config. https://github.com/nix-community/home-manager/blob/613691f285dad87694c2ba1c9e6298d04736292d/modules/programs/zsh.nix#L680 + history.ignorePatterns = [ "(cd|ls) (./|../)*" "pwd" "ls" "cd" ]; oh-my-zsh = { enable = true; @@ -41,7 +45,7 @@ let #"sudo" ]; #theme = "robbyrussell"; - theme = "agnoster"; + theme = "agnoster"; # If in a Git directory, adds the branch to the shell promt. }; }; in