Migrate zsh configuration to new programs.zsh.initContent

This commit is contained in:
JuliusFreudenberger 2025-05-27 22:01:53 +03:00
parent 289eecc497
commit c14b427f49

View file

@ -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 ];
};
}