{ lib, config, pkgs, ... }: with lib; let cfg = config.modules.cli.zsh; in { options.modules.cli.zsh = { enable = mkEnableOption "enable Zsh configuration"; }; config = mkIf cfg.enable { programs.zsh = { enable = true; dotDir = ".config/zsh"; defaultKeymap = "viins"; enableCompletion = true; history = { ignoreAllDups = true; save = 10000; share = true; path = "$HOME/.local/share/zsh/history"; }; historySubstringSearch = { enable = true; searchDownKey = "^[OB"; searchUpKey = "^[OA"; }; syntaxHighlighting = { enable = true; highlighters = [ "brackets" "main" ]; styles = { single-hyphen-option = "fg=blue"; double-hyphen-option = "fg=blue"; function = "fg=blue"; reserved-word = "fg=magenta,bold"; assign = "fg=red"; bracket-level-1 = "fg=blue"; bracket-level-2 = "fg=magenta"; bracket-level-3 = "fg=green"; bracket-error = "fg=red,bold"; cursor-matchingbracket = "fg=magenta,bold"; }; }; completionInit = '' autoload -Uz compinit for dump in ''${ZDOTDIR}/.zcompdump(N.mh+24); do compinit done compinit -C ''; plugins = [ { name = "pure"; src = pkgs.fetchFromGitHub { owner = "sindresorhus"; repo = "pure"; rev = "v1.22.0"; hash = "sha256-TR4CyBZ+KoZRs9XDmWE5lJuUXXU1J8E2Z63nt+FS+5w="; }; } { name = "base16-shell"; src = pkgs.fetchFromGitHub { owner = "chriskempson"; repo = "base16-shell"; rev = "588691ba71b47e75793ed9edfcfaa058326a6f41"; hash = "sha256-X89FsG9QICDw3jZvOCB/KsPBVOLUeE7xN3VCtf0DD3E="; }; } { name = "history-search-multi-word"; src = pkgs.fetchFromGitHub { owner = "zdharma-continuum"; repo = "history-search-multi-word"; rev = "c4dcddc1cd17e7e0909471703f3526170db0f475"; hash = "sha256-KgKm9qzFnwXDXwmTruPgC0tjmiTY5AiGdrWW4zDWUF4="; }; }]; localVariables = { BASE16_THEME = "$HOME/.config/zsh/plugins/base16"; }; }; }; }