shell script based session management
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
SESSION="edit sessions"
|
||||
|
||||
if tmux has-session -t "$SESSION" 2>/dev/null; then
|
||||
if [ -n "$TMUX" ]; then
|
||||
tmux switch-client -t "$SESSION"
|
||||
else
|
||||
tmux attach -t "$SESSION"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
tmux new-session -d -s "$SESSION" -c ~/tmux/ -n "nvim"
|
||||
tmux send-keys -t "$SESSION":"nvim" 'nvim .' C-m
|
||||
|
||||
tmux new-window -t "$SESSION" -c ~/tmux/
|
||||
|
||||
tmux select-window -t "$SESSION":"nvim"
|
||||
if [ -n "$TMUX" ]; then
|
||||
tmux switch-client -t "$SESSION"
|
||||
else
|
||||
tmux attach -t "$SESSION"
|
||||
fi
|
||||
Reference in New Issue
Block a user