Skip to content

Instantly share code, notes, and snippets.

@reborg
Created June 10, 2013 15:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save reborg/5749484 to your computer and use it in GitHub Desktop.
Save reborg/5749484 to your computer and use it in GitHub Desktop.
Handy tmux.sh to add to your new Clojure project that creates a single window with one main Vim pane and a secondary small at the bottom which runs Midje autotest on top of a lein repl session.
export PROJECT_NAME=$1
export WORKING_DIR=/me/prj/$PROJECT_NAME
cd $WORKING_DIR;
# create the session
tmux start-server
tmux new-session -d -s $PROJECT_NAME -n work
# start vim in working dir
tmux select-window -t$PROJECT_NAME:1
tmux send-keys -t$PROJECT_NAME:1 "cd $WORKING_DIR && vim" C-m
# create an horizontal split with an repl midje autotest in it
tmux split-window "cd $WORKING_DIR && lein repl"
tmux send-keys "(use 'midje.repl)" "C-m"
tmux send-keys "(autotest)" "C-m"
tmux resize-pane -D 10
tmux attach-session -d -t$PROJECT_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment