From 10ff8b3644db8b652220cc6d3015c3554dc2835e Mon Sep 17 00:00:00 2001
From: Gabe Venberg <gabevenberg@gmail.com>
Date: Wed, 2 Apr 2025 00:33:42 +0200
Subject: [PATCH] zsh tre integration.

---
 configs/home-manager/zsh.nix | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/configs/home-manager/zsh.nix b/configs/home-manager/zsh.nix
index 8ea8efb..689d576 100644
--- a/configs/home-manager/zsh.nix
+++ b/configs/home-manager/zsh.nix
@@ -46,6 +46,9 @@
             curl cheat.sh/$i
             done
           }
+          #the tre command has some shell integration.
+          tre() { command tre "$@" --editor && source "/tmp/tre_aliases_$USER" 2>/dev/null; }
+          tred() { command tre "$@" --editor=z --directories && source "/tmp/tre_aliases_$USER" 2>/dev/null; }
         ''
         (lib.mkIf (!config.programs.starship.enable) ''
           autoload -U promptinit
@@ -103,5 +106,6 @@
   services.gpg-agent.enableZshIntegration = true;
   home.packages = with pkgs; [
     curl
+    tre-command
   ];
 }