From 9d791cf738fcb7ef28a7df02cb93e6003c478d8b Mon Sep 17 00:00:00 2001 From: materus Date: Sat, 30 Mar 2024 00:01:34 +0100 Subject: [PATCH] home-profile: zsh updates --- configurations/profile/home/shell/zsh.nix | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/configurations/profile/home/shell/zsh.nix b/configurations/profile/home/shell/zsh.nix index 9368d85..c4c3c57 100644 --- a/configurations/profile/home/shell/zsh.nix +++ b/configurations/profile/home/shell/zsh.nix @@ -17,7 +17,8 @@ let makeIfVar = var: val: ret: '' if [ ''$${var} = "${val}" ]; then ${ret} - fi''; + fi + ''; @@ -71,6 +72,7 @@ in envExtra = '' ${makeEnv "__MATERUS_HM_ZSH" "1"} ${makeEnv "__MATERUS_HM_ZSH_PROMPT" cfg.prompt} + ${makeEnv "__MATERUS_HM_ZSH_PRIVATE" "0"} ''; @@ -94,7 +96,7 @@ in extended = true; save = 100000; size = 100000; - share = false; + share = true; ignoreDups = true; ignoreSpace = true; }; @@ -107,6 +109,12 @@ in bindkey -r "^[" bindkey ";5C" forward-word bindkey ";5D" backward-word + + zsh-private() { + __MATERUS_HM_ZSH_PRIVATE=1 ${lib.getExe config.programs.zsh.package} + } + + '' + makeIfVar "__MATERUS_HM_ZSH_PROMPT" "p10k" '' if zmodload zsh/terminfo && (( terminfo[colors] >= 256 )); then @@ -114,7 +122,12 @@ in else [[ ! -f ${p10kcfg}/compatibility.zsh ]] || source ${p10kcfg}/compatibility.zsh fi - ''; + '' + makeIfVar "__MATERUS_HM_ZSH_PRIVATE" "1" '' + unset HISTFILE + ${lib.optionalString config.programs.zsh.history.share "unsetopt SHARE_HISTORY"} + '' + + ; };