From d6c9d40a8a72454a897af2358bd8a3de11c80eb7 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Fri, 11 Aug 2023 00:28:05 -0400 Subject: [PATCH] shells/zsh: move TODO printout into precmd --- users/profiles/shells/zsh.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/users/profiles/shells/zsh.nix b/users/profiles/shells/zsh.nix index c3808e0..97a72e2 100644 --- a/users/profiles/shells/zsh.nix +++ b/users/profiles/shells/zsh.nix @@ -19,11 +19,18 @@ initExtra = '' ${pkgs.kitty}/bin/kitty + complete setup zsh | source /dev/stdin ${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin - if [[ -e ~/TODO.txt && ! -v __TODO_PRINTED ]] then - export __TODO_PRINTED=1 - echo TODO: - \cat ~/TODO.txt - fi + + functions -c precmd precmd_any_nix_shell + + precmd() { + precmd_any_nix_shell + + if [[ -e ~/TODO.txt && ! -v __TODO_PRINTED ]] then + export __TODO_PRINTED=1 + echo TODO: + \cat ~/TODO.txt + fi + } ''; dotDir = ".config/zsh";