-
Notifications
You must be signed in to change notification settings - Fork 2
/
tmux.conf
129 lines (98 loc) · 3.39 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# remap prefix from ^B to backtick `
unbind C-b
set-option -g prefix `
bind ` send-prefix
bind ^ last-window
set-option -sg escape-time 10
# split panes using | and -
bind | split-window -h #-c "#{pane_current_path}"
bind _ split-window -v #-c "#{pane_current_path}"
unbind '"'
unbind %
bind b break-pane -P
unbind !
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
bind p previous-window
bind n next-window
# prefix-Delete or prefix-Shift-Delete to kill panes/windows
bind DC kill-pane
bind S-DC kill-window
# enable mouse control by default
if-shell "if [[ `tmux -V | cut -d' ' -f2` -lt 2.1 ]]; then true; else false; fi" \
'set -g mode-mouse on; set -g mouse-resize-pane on; set -g mouse-select-pane on; set -g mouse-select-window on'
if-shell "if [[ `tmux -V | cut -d' ' -f2` -ge 2.1 ]]; then true; else false; fi" \
'set -g mouse on'
# scroll in copy/paste mode
#bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
#bind -n WheelDownPane select-pane -t= \; send-keys -M
# toggle mouse mode to allow mouse copy/paste
# set mouse off with `m
# set mouse on with `M
# TODO: do version check as above to avoid error messages
bind M \
set -g mouse on \;\
set -g mode-mouse on \;\
set -g mouse-resize-pane on \;\
set -g mouse-select-pane on \;\
set -g mouse-select-window on \;\
display 'Mouse: ON'
# set mouse off with prefix M
bind m \
set -g mouse off \;\
set -g mode-mouse off \;\
set -g mouse-resize-pane off \;\
set -g mouse-select-pane off \;\
set -g mouse-select-window off \;\
display 'Mouse: OFF'
# don't rename windows automatically
set-option -g allow-rename off
###########################################################################
# General options
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal screen-256color
# Ring the bell if any background window rang a bell
set -g bell-action any
# Watch for activity in background windows
setw -g monitor-activity on
# scrollback size
set -g history-limit 10000
# pass through xterm keys
set -g xterm-keys on
set-option -g default-shell /bin/zsh
### Vim-style copy/paste
#unbind '['
#unbind 'q'
#bind '[' copy-mode
#bind ']' paste-buffer
#bind -t vi-copy ' ' begin-selection
#bind -t vi-copy Enter copy-selection
#bind -t vi-copy 'q' cancel
# move current window left and right in the tab list, respectively.
bind '<' swap-window -t -1
bind '>' swap-window -t +1
# to be consistent with i3 and vim window movement
bind 'h' select-pane -L
bind 'j' select-pane -D
bind 'k' select-pane -U
bind 'l' select-pane -R
bind 'H' resize-pane -L 5
bind 'J' resize-pane -D 3
bind 'K' resize-pane -U 3
bind 'L' resize-pane -R 5
# resize the currently selected pane to be 80 columns
bind '\' resize-pane -x 80
# toggle fullscreen
bind f resize-pane -Z
# resize the currently selected pane to 16 rows high
#bind ']' resize-pane -y 16
# use hjkl to move around buffer
setw -g mode-keys vi
bind -t vi-copy y copy-pipe "xclip -sel clip -i"
set-option -g repeat-time 50
# enable scrolling using the Shift-PageUp/Down keys
# TODO: fix S-Pageup/Pagedown
set -g terminal-overrides 'rxvt*:ti@:te@'
bind -n S-Pageup copy-mode -u
# don't use the constrained minimum with multiple clients
setw -g aggressive-resize on