-
Notifications
You must be signed in to change notification settings - Fork 3
/
mytmux
executable file
·34 lines (26 loc) · 1.33 KB
/
mytmux
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
#!/bin/bash
# Run this with ./mytmux.
# If this file is modified, kill the existing session with "tmux kill-session -t mytmux"
# and run this again to reconfigure the "mytmux" session.
# If the "mytmux" session does not exist ...
if ! tmux has-session -t mytmux; then
# Create a new session named "mytmux" and detach.
# The name of the first window will be the command running in it (vim).
tmux new-session -s mytmux -d
# In first window, cd to Node labs directory and
# start Vim with vertical split and in explore mode.
#tmux send-keys -t mytmux:0.0 'cdtraining; cd Node.js/nodejs-labs; vim +vs +E' C-m
# Create a second window named "console" for entering shell commands.
#tmux new-window -n console -t mytmux
#tmux split-window -h -t mytmux:1 # split into two horizontal panes
#tmux split-window -v -t mytmux:1.1 # split right pane into two vertical panes
# In upper-right pane, cd to Node labs directory and start "less-watch".
#tmux send-keys -t mytmux:1.1 'cdtraining; cd Node.js/nodejs-labs' C-m
#tmux send-keys -t mytmux:1.1 'less-watch .' C-m
# In lower-right pane, start "top".
#tmux send-keys -t mytmux:1.2 'top' C-m
#tmux select-window -t mytmux:0 # move focus to first window
#tmux select-pane -t 0 # move focus to vim pane; only one, so not needed
fi
# Attach to the "mytmux" session.
tmux attach -t mytmux