{ config, osConfig, pkgs, ... }: let cfg = osConfig.modules.zsh; xdgCfg = config.xdg; in { imports = [ ./p10k.nix ]; programs.zsh = { enable = cfg.enable; dotDir = "${xdgCfg.configHome}/zsh"; autosuggestion.enable = false; enableCompletion = true; syntaxHighlighting = { enable = true; highlighters = [ "main" "brackets" "pattern" "root" ]; }; historySubstringSearch.enable = true; history = { append = true; ignoreDups = false; ignoreSpace = true; save = 100000; share = true; size = 100000; extended = true; }; initContent = '' # p10k source "${xdgCfg.configHome}/zsh/p10k.zsh"; # vi keybindings for menu select bindkey -M menuselect 'h' vi-backward-char bindkey -M menuselect 'k' vi-up-line-or-history bindkey -M menuselect 'j' vi-down-line-or-history bindkey -M menuselect 'l' vi-forward-char # Tab to accept current selection bind-key -M menuselect '^I' accept-and-infer-next-history # Load fzf keybindings if [ -n "''${commands[fzf-share]}" ]; then source "$(fzf-share)/key-bindings.zsh"; source "$(fzf-share)/completion.zsh"; fi ''; shellAliases = { ".." = "cd .."; "..." = "cd ../.."; ls = "ls --color=auto"; ll = "ls -al"; grep = "grep --color=auto"; back = "cd $OLDPWD"; gs = "git status"; ssha = "eval $(ssh-agent) && ssh-add"; }; plugins = [ { name = "powerlevel10k"; src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/"; file = "powerlevel10k.zsh-theme"; } ]; }; }