Created
August 19, 2025 14:56
-
-
Save withakay/dec184e9a0a5111b929e6ad8f0399d04 to your computer and use it in GitHub Desktop.
Revisions
-
withakay created this gist
Aug 19, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ # include this in your .bash_profile or .zshrc or similar # Note: you can't put this in script and call it as `cd` will only affect # the subshell the script runs in function wtcd () { local dir dir=$(git wtl --porcelain | grep "^worktree" | awk '{print $2}'| fzf \ --height=40% \ --layout=reverse \ --border \ --prompt="Select worktree: " \ --preview="echo {} | awk '{print \$1}' | xargs ls -la 2>/dev/null | head -20" \ --preview-window=right:50%:wrap) && cd "$dir" }