Add tmux session script for nix configuration workspace
- Create automated tmux session setup with 3 windows: nvim, ai, and bash - Auto-start nvim in first window and claude in ai window with split panes - Provides quick workspace initialization for nix config development 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
d2d1d7fd6f
commit
b30b393541
1 changed files with 23 additions and 0 deletions
23
tmux.sh
Normal file
23
tmux.sh
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
SESSION_NAME="nix"
|
||||
WORK_DIR="/Users/yanlin/.config/nix"
|
||||
|
||||
if tmux has-session -t $SESSION_NAME 2>/dev/null; then
|
||||
tmux attach-session -t $SESSION_NAME
|
||||
exit 0
|
||||
fi
|
||||
|
||||
tmux new-session -d -s $SESSION_NAME -c "$WORK_DIR"
|
||||
tmux rename-window -t $SESSION_NAME:1 "nvim"
|
||||
tmux send-keys -t $SESSION_NAME:1 "nvim" C-m
|
||||
tmux new-window -t $SESSION_NAME:2 -n "ai"
|
||||
tmux send-keys -t $SESSION_NAME:2 "claude -r" C-m
|
||||
tmux split-window -t $SESSION_NAME:2 -h
|
||||
tmux split-window -t $SESSION_NAME:2.2 -v
|
||||
tmux select-pane -t $SESSION_NAME:2.1
|
||||
tmux new-window -t $SESSION_NAME:3 -n "bash"
|
||||
|
||||
tmux select-window -t $SESSION_NAME:1
|
||||
|
||||
tmux attach-session -t $SESSION_NAME
|
||||
Loading…
Add table
Add a link
Reference in a new issue