-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
44 lines (38 loc) · 1.5 KB
/
.tmux.conf
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
40
41
42
43
44
set -g default-terminal "screen-256color"
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# reload the conf file on the fly
bind r source-file ~/.tmux.conf
# who knows what this does, but I can now scroll in a tmux pane
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# repeat last shell command on right pane (if it happens to be a shell)
bind-key s select-pane -t 1 \; send-keys C-c Up C-m \; last-pane
# swap right pane in window 0 with default pane in window 1
#
# make sure our current window is listed as 0
# create a second window if it doesn't exist
# select our 0 window again in case we created a new one
# select our second pane in 0 window
# join that pane to window 1
# select the pane above the one we just moved there
# move that pane to window 0
# send the up arrow and enter to that pane (run last shell command)
# switch to last pane, which will be window 0, pane 0 (primary left)
# make sure we are horiontal-even
# redraw vim -- since it gets fucked up in this build when selecting
# layout programmatically. This whole thing assumes vim in left pane.
bind-key d \
if-shell 'tmux select-window -t :0' '' 'move-window -t :0' \; \
if-shell 'test $(tmux list-panes | wc -l) -gt 1' '' 'split-window -h' \; \
if-shell 'tmux select-window -t :1' '' 'new-window' \; \
select-window -t 0 \; \
select-pane -t 1 \; \
join-pane -t 1.0 \; \
select-pane -U \; \
join-pane -h -t 0.0 \; \
last-pane
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R