diff --git a/modules/home/zsh/default.nix b/modules/home/zsh/default.nix index e782b2c..0b77b3b 100644 --- a/modules/home/zsh/default.nix +++ b/modules/home/zsh/default.nix @@ -1,9 +1,11 @@ { config, + lib, osConfig, pkgs, ... }: +with lib; let cfg = osConfig.modules.zsh; xdgCfg = config.xdg; @@ -38,23 +40,33 @@ in extended = true; }; - initContent = '' - # p10k - source "${xdgCfg.configHome}/zsh/p10k.zsh"; - + initContent = + let + zshConfigInitEarly = mkOrder 500 '' + # p10k + # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. + # Initialization code that may require console input (password prompts, [y/n] + # confirmations, etc.) must go above this block; everything else may go below. + if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then + source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" + fi + source "${xdgCfg.configHome}/zsh/p10k.zsh"; + ''; + zshConfig = mkOrder 1000 '' # 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 + #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 + #bindkey -M menuselect '^I' accept-and-infer-next-history # Control arrow keys bindkey '^[[1;5C' forward-word bindkey '^[[1;5D' backward-word ''; + in mkMerge [ zshConfigInitEarly zshConfig ]; shellAliases = { ".." = "cd ..";