-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRIDE.sh
More file actions
executable file
·39 lines (34 loc) · 1.04 KB
/
RIDE.sh
File metadata and controls
executable file
·39 lines (34 loc) · 1.04 KB
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
34
35
36
37
38
39
#!/usr/bin/env bash
#
##############################################################
echo $1
cd ${1}
echo $(pwd)
# now start a tmux session
# inspired by : http://www.whiteboardcoder.com/2015/01/tmux-scripting.html
### start a session (but do not attach it yet)
session_name="RIDE$(basename ${1})"
echo ${session_name}
tmux new -s "${session_name}" -d
#### create the second window
tmux split-window -h -t "${session_name}"
tmux select-pane -t 0
if [ -d tests ];then
### start vi in first pane
tmux send-keys "vim -c 'vnew |lcd pkg/R|edit .|wincmd l|lcd tests|edit .'" C-m
tmux send-keys -t 1 'cd tests' C-m
fi
if [ -d pkg/inst/tests ];then
### start vi in first pane
tmux send-keys "cd pkg && vim -c 'vnew |lcd R|edit .|wincmd l|lcd inst/tests|edit .'" C-m
tmux send-keys -t 1 'cd pkg/inst/tests ' C-m
fi
tmux select-pane -t 1
##### create the third window
#tmux split-window -h -t ${session_name}
##
##### go back to vi pane
#tmux select-pane -t 0
#### attach the session
tmux attach -t ${session_name}
#$SHELL