From 532685d65e13e2ca51009c0fc29aa604f779760c Mon Sep 17 00:00:00 2001
From: Anthony Cicchetti <anthony@anthonycicchetti.com>
Date: Mon, 6 May 2024 16:44:12 -0400
Subject: [PATCH] carapace

---
 nix/home-manager/flake.lock                   | 18 +++++++--------
 nix/home-manager/modules/packages/default.nix |  1 +
 nix/home-manager/modules/packages/zsh.nix     |  4 ++++
 zsh/zshrc                                     | 23 ++++++++++++-------
 4 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/nix/home-manager/flake.lock b/nix/home-manager/flake.lock
index e942d6a..d8206f7 100644
--- a/nix/home-manager/flake.lock
+++ b/nix/home-manager/flake.lock
@@ -83,11 +83,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1714515075,
-        "narHash": "sha256-azMK7aWH0eUc3IqU4Fg5rwZdB9WZBvimOGG3piqvtsY=",
+        "lastModified": 1714900398,
+        "narHash": "sha256-H7XYHpjk1G6dkA3AnbYrKtaTFjcCE7ul6nUVlVQxtsA=",
         "owner": "nix-community",
         "repo": "home-manager",
-        "rev": "6d3b6dc9222c12b951169becdf4b0592ee9576ef",
+        "rev": "fdaaf543bad047639ef0b356ea2e6caec2f1215c",
         "type": "github"
       },
       "original": {
@@ -141,11 +141,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1714273701,
-        "narHash": "sha256-bmoeZ5zMSSO/e8P51yjrzaxA9uzA3SZAEFvih6S3LFo=",
+        "lastModified": 1714878592,
+        "narHash": "sha256-E68C03sYRsYFsK7wiGHUIJm8IsyPRALOrFoTL0glXnI=",
         "owner": "Mic92",
         "repo": "nix-index-database",
-        "rev": "941c4973c824509e0356be455d89613611f76c8a",
+        "rev": "a362555e9dbd4ecff3bb98969bbdb8f79fe87f10",
         "type": "github"
       },
       "original": {
@@ -226,11 +226,11 @@
     },
     "nixpkgs_2": {
       "locked": {
-        "lastModified": 1714651394,
-        "narHash": "sha256-WMdK40HkHnq8BK29EX/JgrNGMZRMnHztfMtW8BNRy9M=",
+        "lastModified": 1714922915,
+        "narHash": "sha256-z90OXTwkN22RE+sM32SXWAU5u3GgSgaYp9YBw4GCIcQ=",
         "owner": "nixOS",
         "repo": "nixpkgs",
-        "rev": "0a4529b1f1133f539d8718d495ad1aae94b6221d",
+        "rev": "93e49991ad7027bf87a8ab505107c5018d62d7d9",
         "type": "github"
       },
       "original": {
diff --git a/nix/home-manager/modules/packages/default.nix b/nix/home-manager/modules/packages/default.nix
index 340b587..b7eaecd 100644
--- a/nix/home-manager/modules/packages/default.nix
+++ b/nix/home-manager/modules/packages/default.nix
@@ -39,6 +39,7 @@ in {
       gnutar
       gql
       imagemagick
+      inshellisense
       internetarchive
       jless
       jq
diff --git a/nix/home-manager/modules/packages/zsh.nix b/nix/home-manager/modules/packages/zsh.nix
index 16ed6dc..e18e2c5 100644
--- a/nix/home-manager/modules/packages/zsh.nix
+++ b/nix/home-manager/modules/packages/zsh.nix
@@ -90,4 +90,8 @@ in {
     in
       {zj = "zellij -l welcome";} // platformSpecificAliases;
   };
+  programs.carapace = {
+    enable = true;
+    enableZshIntegration = true;
+  };
 }
diff --git a/zsh/zshrc b/zsh/zshrc
index 485d746..918d69d 100644
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -22,13 +22,18 @@ fi
 
 fpath=(~/bin ~/.zshcompletions $fpath)
 zstyle :compinstall filename '/home/anthonys/.zshrc'
-zstyle ":completion:*" complete _complete _ignored _approximate _expand
-zstyle ":completion:*" glob 1
-zstyle ":completion:*" insert-unambiguous true
-zstyle ':completion:*' menu select
-zstyle ':completion:*' rehash true
-zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'l:|=* r:|=*'
-zstyle ":completion:*" substitute 1
+export CARAPACE_BRIDGES='zsh,fish,bash,inshellisense'
+zstyle ':completion:*' format $'\e[2;37mCompleting %d\e[m'
+# Both because it's nice and as an example
+zstyle ':completion:*:git:*' group-order 'main commands' 'alias commands' 'external commands'
+
+# zstyle ":completion:*" complete _complete _ignored _approximate _expand
+# zstyle ":completion:*" glob 1
+# zstyle ":completion:*" insert-unambiguous true
+# zstyle ':completion:*' menu select
+# zstyle ':completion:*' rehash true
+# zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'l:|=* r:|=*'
+# zstyle ":completion:*" substitute 1
 
 [[ -n "$key[Up]"   ]] && bindkey -- "$key[Up]"   up-line-or-beginning-search
 [[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search
@@ -40,7 +45,9 @@ if [[ -d ~/.cargo/bin ]]; then
 fi
 
 function dt() {
-    zellij -l welcome
+    local session_name=${1:-DefaultSession}
+    
+    zellij attach -c $session_name
 } 
 
 function root() {