Practical setups and configurations for everyday development tasks
Share tmux sessions with teammates for real-time collaboration without screen sharing tools.
Efficiently debug applications with a multi-pane setup that lets you see code, logs, and interact with your program simultaneously.
Organize large projects with named windows and sessions. Create project startup scripts to instantly launch your development environment.
#!/bin/bash
# project-start.sh
SESSION="project"
# Create session if it doesn't exist
tmux has-session -t $SESSION 2>/dev/null
if [ $? != 0 ]; then
# Create a new session
tmux new-session -d -s $SESSION
# Rename first window to "editor"
tmux rename-window -t $SESSION:0 "editor"
tmux send-keys -t $SESSION:editor "cd ~/projects/myapp" C-m
tmux send-keys -t $SESSION:editor "vim ." C-m
# Create server window
tmux new-window -t $SESSION:1 -n "server"
tmux send-keys -t $SESSION:server "cd ~/projects/myapp" C-m
tmux send-keys -t $SESSION:server "npm start" C-m
# Create a tests window
tmux new-window -t $SESSION:2 -n "tests"
tmux send-keys -t $SESSION:tests "cd ~/projects/myapp" C-m
tmux send-keys -t $SESSION:tests "npm test -- --watch" C-m
# Return to editor window
tmux select-window -t $SESSION:0
fi
# Attach to session
tmux attach-session -t $SESSION
chmod +x project-start.sh
./project-start.sh to start
Prefix + d when needed
A typical development environment with an editor, server, and utility panes all in one tmux session.
Manage multiple remote servers from a single terminal window. Keep sessions alive even when your connection drops.
#!/bin/bash
# Connect to multiple servers in one tmux session
# Create new session with window 1
tmux new-session -d -s servers -n "web-server"
tmux send-keys -t servers:web-server "ssh user@web-server" C-m
# Create window 2
tmux new-window -t servers:1 -n "db-server"
tmux send-keys -t servers:db-server "ssh user@db-server" C-m
# Create window 3
tmux new-window -t servers:2 -n "cache-server"
tmux send-keys -t servers:cache-server "ssh user@cache-server" C-m
# Select window 1 and attach to the session
tmux select-window -t servers:0
tmux attach-session -t servers
Key advantages:
Create a dedicated environment for database operations with SQL queries, schema visualization, and documentation.
#!/bin/bash
# Database workspace setup
SESSION="db-work"
tmux new-session -d -s $SESSION
# Split the window horizontally
tmux split-window -h -t $SESSION:0
# Split the right pane vertically
tmux split-window -v -t $SESSION:0.1
# Left pane: SQL client
tmux send-keys -t $SESSION:0.0 "mysql -u username -p database_name" C-m
# Top right: Schema visualization
tmux send-keys -t $SESSION:0.1 "watch -n 5 'mysql -u username -p database_name -e \"SHOW TABLES;\"'" C-m
# Bottom right: Documentation/notes in Vim
tmux send-keys -t $SESSION:0.2 "vim db-notes.md" C-m
# Select the first pane and attach
tmux select-pane -t $SESSION:0.0
tmux attach-session -t $SESSION
Operations supported:
The true power of Vim + Tmux comes from integrating them into your team's daily workflows.
Ready to try these workflows yourself?