From a994241c32afe471c0cfe3eb2a2e65680eb305dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pacana?= Date: Fri, 31 Jul 2026 08:27:41 +0200 Subject: [PATCH] Add worktree picker * Add a small fish helper for jumping into linked worktrees from any directory. * Keep the picker plain so it follows the shared fzf defaults instead of adding command-specific prompts or previews. --- modules/fish.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/modules/fish.nix b/modules/fish.nix index 48673d1..62297b6 100644 --- a/modules/fish.nix +++ b/modules/fish.nix @@ -9,6 +9,26 @@ enable = true; shellAliases.less = "less -R"; + functions.wt = '' + set -l root "$HOME/Code/worktrees" + + if not test -d "$root" + echo "No worktrees in $root" >&2 + return 1 + end + + set -l selected ( + fd --base-directory "$root" --max-depth 2 --min-depth 2 --type directory . \ + | fzf + ) + + if test -z "$selected" + return + end + + cd "$root/$selected" + ''; + # Upstream hydro prompt; local deviations go through its public # variables (see conf.d/hydro-theme.fish below), no forked functions. plugins = [ -- 2.51.2