Created
June 10, 2013 15:07
-
-
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.
This file contains hidden or 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
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