feat(tmux): improve ta, ts and bindings

This commit is contained in:
Moritz Böhme 2023-10-08 13:33:57 +02:00
parent 28961fe114
commit 1eb008e41e
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
4 changed files with 9 additions and 11 deletions

8
modules/programs/tmux/tmux-sessionizer/script.fish Normal file → Executable file
View file

@ -1,10 +1,10 @@
#!/usr/bin/env fish
set pipe (mktemp --dry-run)
mkfifo $pipe
fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec dirname {} | tee $pipe >/dev/null &
fd . ~/ --min-depth 1 --max-depth 3 --type d | tee $pipe >/dev/null &
set selected (cat $pipe | fzf $argv)
fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec-batch dirname {} | tee $pipe >/dev/null &
fd . ~/ --min-depth 1 --max-depth 3 --type d --exec-batch realpath {} | tee $pipe >/dev/null &
set selected (cat $pipe | awk '!seen[$0]++' | fzf --query "$argv")
rm -f "$pipe"
set selected_name (basename $selected 2>/dev/null | string replace "." "_")