-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartup
More file actions
executable file
·33 lines (24 loc) · 845 Bytes
/
startup
File metadata and controls
executable file
·33 lines (24 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
init_dir() {
WORKING_DIR="~/projects/$1"
tmux send-keys "cd $WORKING_DIR" C-m
tmux send-keys "source ~/.virtualenvs/$1/bin/activate" C-m
tmux send-keys "test -f $WORKING_DIR/.env && source .env" C-m
tmux send-keys "test -f $WORKING_DIR/.nvmrc && nvm use" C-m
}
tmux new-session -s "$1" -d
tmux rename-window main
tmux select-window -t "$1":main
init_dir "$@"
tmux split-window -h -t "$1":main
tmux select-pane -t "$1":main.1
init_dir "$@"
tmux split-window -v -t "$1":main.0
tmux select-pane -t "$1":main.1
init_dir "$@"
tmux new-window -t "$1" -n edit
tmux select-window -t "$1":edit
init_dir "$@"
tmux send-keys 'ctags -R ./**/*.py ~/.virtualenvs/$(basename $PWD)/lib/python$(python --version | cut -d " " -f 2 | cut -d "." -f 1,2)/site-packages/**/*.py' C-m
tmux send-keys "vim" C-m
tmux attach -t "$1"