From 018c4cbf631cb86b765c6ef40dd33c94105d5e0a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 2 Mar 2020 15:10:32 +0100 Subject: zsh: optimise startup - compile init file - pre-generate and compile compinit dump (zcompdump) --- user/settings/zsh.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'user') diff --git a/user/settings/zsh.nix b/user/settings/zsh.nix index 5d62101a..b409e728 100644 --- a/user/settings/zsh.nix +++ b/user/settings/zsh.nix @@ -4,6 +4,7 @@ let inherit (pkgs) stdenv; lsOptions = if stdenv.isDarwin then "-p" else "-v --group-directories-first"; lsIsoDate = if stdenv.isDarwin then "" else "--time-style=long-iso"; + zshrc = ".config/zsh/.zshrc"; mkZshPlugin = attrs: { name = attrs.name; src = stdenv.mkDerivation { @@ -254,4 +255,6 @@ in '' + builtins.readFile ../zsh/.config/zsh/.zshrc; }; + + home.file."${zshrc}".onChange = "${pkgs.zsh}/bin/zsh -i -c 'autoload -Uz compinit && compinit && zcompile ${zshrc}'"; } -- cgit 1.4.1