From 1e7a2f34252e059f2685328bc39361b42fbdd4f9 Mon Sep 17 00:00:00 2001 From: Tibor Pilz Date: Tue, 31 Dec 2024 16:04:29 +0100 Subject: [PATCH] fix(shell): fix gotoworkspace script name --- home/modules/scripts.nix | 1 + home/scripts/completions/_gotoworkspace | 9 +++++++++ home/scripts/{switchorspawn => gotoworkspace} | 0 3 files changed, 10 insertions(+) create mode 100644 home/scripts/completions/_gotoworkspace rename home/scripts/{switchorspawn => gotoworkspace} (100%) diff --git a/home/modules/scripts.nix b/home/modules/scripts.nix index 8ae793b8..a2ce3f13 100644 --- a/home/modules/scripts.nix +++ b/home/modules/scripts.nix @@ -28,5 +28,6 @@ in ''; modules.shell.zsh.aliases.ccd = ". $(which codedirs)"; + modules.shell.zsh.aliases.gw = ". $(which gotoworkspace)"; }; } diff --git a/home/scripts/completions/_gotoworkspace b/home/scripts/completions/_gotoworkspace new file mode 100644 index 00000000..0d781555 --- /dev/null +++ b/home/scripts/completions/_gotoworkspace @@ -0,0 +1,9 @@ +#compdef codedirs + +PROJECTS_DIR=${PROJECTS_DIR:-~/Code} + +local -a subdirs +subdirs=($(find "$PROJECTS_DIR" -maxdepth 1 -type d -not -path "$PROJECTS_DIR" -exec basename {} \;)) +_describe -t directories "project directory" subdirs -S/ + +return 0 diff --git a/home/scripts/switchorspawn b/home/scripts/gotoworkspace similarity index 100% rename from home/scripts/switchorspawn rename to home/scripts/gotoworkspace