From c14b427f498cb8621c47938975bfe1f137a4dce5 Mon Sep 17 00:00:00 2001 From: JuliusFreudenberger Date: Tue, 27 May 2025 22:01:53 +0300 Subject: [PATCH] Migrate zsh configuration to new programs.zsh.initContent --- home/zsh/default.nix | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/home/zsh/default.nix b/home/zsh/default.nix index bfcc5c3..ece5c8e 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -1,5 +1,14 @@ -{lib, config, pkgs, pkgs-unstable, ...}: { - programs.zsh = { +{lib, config, pkgs, ...}: { + programs.zsh = let + beforeCompInit = lib.mkOrder 550 "zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=* r:|=*'"; + defaultInit = '' + setopt promptsubst + export PROMPT='%F{12}[%f%F{10}%n%f%F{12}@%f%F{white}%m%f%F{12}]%f%F{white}:%f %F{white}%~%f%F{12}>%b$(${lib.getExe pkgs.gitprompt-rs} zsh)%f%F{10}%(!.#.$)%f ' + unsetopt beep + bindkey '^R' history-incremental-search-backward + ''; + in + { enable = true; enableCompletion = true; autosuggestion.enable = true; @@ -17,17 +26,6 @@ history.size = 10000; history.path = "$HOME/.zsh_history"; - plugins = [ - - ]; - - initExtra = '' - setopt promptsubst - export PROMPT='%F{12}[%f%F{10}%n%f%F{12}@%f%F{white}%m%f%F{12}]%f%F{white}:%f %F{white}%~%f%F{12}>%b$(${lib.getExe pkgs-unstable.gitprompt-rs} zsh)%f%F{10}%(!.#.$)%f ' - unsetopt beep - bindkey '^R' history-incremental-search-backward - ''; - - initExtraBeforeCompInit = "zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=* r:|=*'"; + initContent = lib.mkMerge [ beforeCompInit defaultInit ]; }; }