Last active
February 3, 2017 21:55
-
-
Save vnegrisolo/3e126de8168dd6305afe to your computer and use it in GitHub Desktop.
Open tmux with sessions and panes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mux() { | |
if [ -z "$@" ]; then | |
echo 'usage ./tmux.sh <project_name> [<project2]'; | |
fi | |
for project in "$@"; do | |
cd ${project}; | |
project=${project%/}; | |
project=${project//\./-} | |
tmux new -d -s ${project}; | |
tmux rename-window -t ${project}:0 code; | |
tmux select-window -t ${project}:0; | |
tmux split-window -h 'vim .'; | |
tmux new-window; | |
tmux rename-window -t ${project}:1 server; | |
tmux select-layout -t ${project}:0 main-vertical; | |
tmux select-window -t ${project}:0; | |
echo "New session on tmux=${project}"; | |
cd ..; | |
done | |
echo "Tmux sessions:" | |
tmux ls; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment