Skip to content

Instantly share code, notes, and snippets.

@jiuks
Created September 24, 2012 23:25
Show Gist options
  • Save jiuks/3779072 to your computer and use it in GitHub Desktop.
Save jiuks/3779072 to your computer and use it in GitHub Desktop.
tmux file for rails
#!/bin/bash
# ====================================================================
# This is the tmux configuration I use for setting up my Ruby on Rails
# Tutorial session
#
BASE="~/apps/envtest"
cd $BASE
tmux start-server
# new-session creates first window named 'editor'
tmux new-session -d -s rails -n editor
# create a second window for logs
tmux new-window -t rails:2 -n logs
# create a third window for the rails server
tmux new-window -t rails:3 -n server
# start a vim editor in the editor window
tmux send-keys -t rails:editor "cd $BASE; vim" C-m
# start rails server
tmux send-keys -t rails:server "cd $BASE; rails s" C-m
# start logging
tmux send-keys -t rails:logs "cd $BASE; tail -f log/*.log" C-m
# select the vim pane in the rails window
tmux select-window -t rails:editor
# make the tmux session active
tmux attach-session -d -t rails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment