Skip to content

Instantly share code, notes, and snippets.

@krisleech
Created March 30, 2012 09:40
Show Gist options
  • Save krisleech/2250386 to your computer and use it in GitHub Desktop.
Save krisleech/2250386 to your computer and use it in GitHub Desktop.
automate tmux for quickstart rails project
#!/bin/sh
function matripa
{
BASE="$HOME/code/matripa"
cd $BASE
tmux start-server
tmux new-session -d -s matripa -n vim
tmux new-window -t matripa:1 -n tests
tmux new-window -t matripa:2 -n servers
tmux new-window -t matripa:3 -n logs
tmux send-keys -t matripa:0 "cd $BASE; vim" C-m
tmux send-keys -t matripa:1 "cd $BASE; guard -c" C-m
tmux send-keys -t matripa:2 "cd $BASE; foreman start" C-m
tmux send-keys -t matripa:3 "cd $BASE; tail -f log/*.log" C-m
tmux select-window -t matripa:0
tmux attach-session -t matripa
}
# ~/.zshrc
source ~/bin/zsh/matripa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment