Skip to content

Instantly share code, notes, and snippets.

@common-nighthawk
Last active March 18, 2017 19:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save common-nighthawk/2a735f0adf89deef031781f6bb63a535 to your computer and use it in GitHub Desktop.
Save common-nighthawk/2a735f0adf89deef031781f6bb63a535 to your computer and use it in GitHub Desktop.
tmux script to launch Figure project
#!/bin/sh
tmux has-session -t figure
if [ $? != 0 ]
then
tmux new-session -s figure -n editor -d
tmux send-keys -t figure 'cd ~/Documents/go-workspace/src/figure/' C-m
tmux send-keys -t figure 'vim' C-m
tmux split-window -h -p 40 -t figure
tmux send-keys -t figure:0.1 'cd ~/Documents/go-workspace/src/figure/' C-m
tmux new-window -n console -t figure
tmux send-keys -t figure:1 'cd ~/Documents/go-workspace/src/figure/' C-m
tmux select-window -t figure:0
fi
tmux attach -t figure
# this is my script that i run every time i work on a project called Figure
# the first line checks if a tmux session is already running with the name 'figure'
# if it is, it'll open it
# if not, we drop into the block
# this creates the new session
# and opens 2 windows
# the first window is named 'editor' and the second window is named 'console'
# the first window is split vertically, the left side opens vim and left is empty (i usually run the db here)
# the second window is empty (i usually work with git here)
# each pane cd's into the correct directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment