-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
62 lines (55 loc) · 2.13 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
new-session
# Version-specific commands [grumble, grumble]
# See: https://github.com/tmux/tmux/blob/master/CHANGES
run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6-)"
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.1" | bc)" = 1 ]' \
"set -g mouse-select-pane on; set -g mode-mouse on; \
set -g mouse-resize-pane on; set -g mouse-select-window on"
# In version 2.1 "mouse" replaced the previous 4 mouse options
if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.1" | bc)" = 1 ]' \
"set -g mouse on"
# UTF8 is autodetected in 2.2 onwards, but errors if explicitly set
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.2" | bc)" = 1 ]' \
"set -g utf8 on; set -g status-utf8 on; set -g mouse-utf8 on"
# bind-key syntax changed in 2.4
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.4" | bc)" = 1 ]' \
"bind-key -t vi-copy v begin-selection; \
bind-key -t vi-copy V select-line; \
bind-key -t vi-copy C-v rectangle-toggle; \
bind-key -t vi-copy y copy-pipe 'xclip -selection clipboard -in'"
# Newer versions
if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.4" | bc)" = 1 ]' \
"bind-key -T copy-mode-vi v send -X begin-selection; \
bind-key -T copy-mode-vi V send -X select-line; \
bind-key -T copy-mode-vi C-v send -X rectangle-toggle; \
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel 'xclip -selection clipboard -in'"
#nested tmux
unbind C-a
set -g prefix C-b
set -g status-bg colour40
setw -g window-status-current-bg colour40
bind -n C-t new-window -a
bind -n S-left prev
bind -n S-right next
bind -n S-C-left swap-window -t -1
bind -n S-C-right swap-window -t +1
bind -n M-F11 set -qg status-bg colour25
bind -n M-F12 set -qg status-bg colour40
bind -n S-up \
send-keys M-F12 \; \
set -qg status-bg colour25 \; \
unbind -n S-left \; \
unbind -n S-right \; \
unbind -n S-C-left \; \
unbind -n S-C-right \; \
unbind -n C-t \; \
set -qg prefix C-a
bind -n S-down \
send-keys M-F11 \; \
set -qg status-bg colour40 \; \
bind -n S-left prev \; \
bind -n S-right next \; \
bind -n S-C-left swap-window -t -1 \; \
bind -n S-C-right swap-window -t +1 \; \
bind -n C-t new-window -a -c "#{pane_current_path}" \; \
set -qg prefix C-b