feat(tmux): add fish completions
This commit is contained in:
parent
3e8ff2e064
commit
b8be6a3a4e
6 changed files with 77 additions and 22 deletions
13
modules/programs/tmux/tmux-sessionizer/script.fish
Normal file
13
modules/programs/tmux/tmux-sessionizer/script.fish
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
set selected (fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec dirname {} | fzf1 $argv)
|
||||
|
||||
set selected_name (basename $selected 2>/dev/null | string replace "." "_")
|
||||
|
||||
if not test -n "$selected_name"
|
||||
exit 1
|
||||
end
|
||||
|
||||
if ! tmux has-session -t $selected_name 2> /dev/null
|
||||
tmux new-session -ds $selected_name -c $selected
|
||||
end
|
||||
|
||||
tmux-switch $selected_name
|
||||
Loading…
Add table
Add a link
Reference in a new issue