Last active
March 18, 2017 19:37
-
-
Save common-nighthawk/2a735f0adf89deef031781f6bb63a535 to your computer and use it in GitHub Desktop.
tmux script to launch Figure project
This file contains 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
#!/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