Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions modules/zsh/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ in
"match_prev_cmd"
]
);
default = [ "history" ];
default = [
"history"
"completion"
];
};
};

Expand All @@ -116,6 +119,11 @@ in
default = false;
description = "save timestamps with history";
};
share = lib.mkOption {
type = lib.types.bool;
default = false;
description = "share history between sessions";
};
save = lib.mkOption {
type = lib.types.int;
default = 10000;
Expand Down Expand Up @@ -225,6 +233,15 @@ in
"HISTSIZE=${toString cfg.history.size}"
"HISTSAVE=${toString cfg.history.save}"

(lib.optionalString cfg.history.append "setopt appendhistory")
(lib.optionalString cfg.history.share "setopt sharehistory")
(lib.optionalString cfg.history.ignoreSpace "setopt hist_ignore_space")
(lib.optionalString cfg.history.ignoreAllDups "setopt hist_ignore_all_dups")
(lib.optionalString cfg.history.ignoreDups "setopt hist_ignore_dups")
(lib.optionalString cfg.history.saveNoDups "setopt hist_save_no_dups")
(lib.optionalString cfg.history.findNoDups "setopt histfindnodups")
(lib.optionalString cfg.history.expanded "setopt extendedhistory")

"# Extra Content"

config.extraRC
Expand Down Expand Up @@ -254,14 +271,7 @@ in

flags = {
"--histfcntllock" = true;
"--histappend" = cfg.history.append;
"--histexpiredupsfirst" = cfg.history.expireDupsFirst;
"--histfindnodups" = cfg.history.findNoDups;
"--histignorealldups" = cfg.history.ignoreAllDups;
"--histignoredups" = cfg.history.ignoreDups;
"--histignorespace" = cfg.history.ignoreSpace;
"--histsavenodups" = cfg.history.saveNoDups;
"--histexpand" = cfg.history.expanded;
};

env.ZDOTDIR = builtins.toString (
Expand Down
Loading