improves tmux config
This commit is contained in:
parent
cce43517a9
commit
88e0931762
2 changed files with 29 additions and 10 deletions
|
|
@ -70,18 +70,24 @@
|
|||
end
|
||||
'';
|
||||
sessionizer = /* fish */ ''
|
||||
set -l selected (dev_projects | fzf --prompt "Create/switch to session: ")
|
||||
set -l selected (dev_projects | fzf --prompt "Create/switch to session: " --reverse --header ' Ctrl-d: Kill Session' --bind 'ctrl-d:execute(tmux kill-session -t {2..})++reload(dev_projects)')
|
||||
if test -z "$selected"
|
||||
return 1
|
||||
end
|
||||
|
||||
set -l session_name (basename $selected)
|
||||
set -l tmux_runnning (pgrep tmux)
|
||||
|
||||
if test $ZELLIJ -eq 0
|
||||
zellij pipe --plugin file:/run/current-system/sw/bin/zellij-switch.wasm -- "--session $session_name --cwd $selected --layout default"
|
||||
else
|
||||
zellij attach "$session_name" --create
|
||||
if test -z $TMUX and -z @tmux_running
|
||||
tmux new-session -s $selected_name -c $selected
|
||||
return 0
|
||||
end
|
||||
|
||||
if not tmux has-session -t=$selected_name 2> /dev/null
|
||||
tmux new-session -ds $selected_name -c $selected
|
||||
end
|
||||
|
||||
tmux switch-client -t $selected_name
|
||||
'';
|
||||
nn = /* fish */ ''
|
||||
# Require a title argument
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue