-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
211 lines (172 loc) · 7.27 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
############################################
#### File: ~/.tmux.conf ##
#### Description: tmux configuration file ##
############################################
############################################
#### General ###############################
############################################
set -g base-index 1 # Base index for numbering windows
set -g bell-action any # Any window can cause bell action
set -g bell-on-alert on # Ring terminal bell on acitivity
set -g buffer-limit 16 # Number of copy buffers
set -g default-terminal 'screen-256color' # Use colors
set -g display-time 1000 # Time (ms) the message bar is shown
set -g history-limit 65536 # Number of tmux commands to remember (2^16)
set -g mode-keys vi # Use Vi bindings in copy and choice mode
set -g mouse on # Mouse mode
set -g monitor-activity off # Monitor windows for activity
set -g status-keys vi # Vi bindings in tmux command prompt
set -g xterm-keys on # Allow using ctrl + arrow keys
# Mouse mode (old tmux versions)
# set -g mouse-resize-pane on
# set -g mouse-select-pane on
# set -g mouse-select-window on
############################################
#### UI ####################################
############################################
#H - host
#S - session
#I - window
#P - pane
#W - program
#T - text
#F - active
# Terminal window / tab title
set -g set-titles on
set -g set-titles-string '#S:#I:#P:#W' # session:window:pane:program
# Window titles
set -g allow-rename off # Allow programs to rename titles
set -g automatic-rename off # Rename titles automatically
# Panes
set -g pane-border-bg default
set -g pane-border-fg colour237
set -g pane-active-border-bg default
set -g pane-active-border-fg brightred # Highlight active panel
# Messages
set -g message-bg brightred
set -g message-fg colour235
set -g message-command-bg brightred
set -g message-command-fg colour235
# Modes
set -g mode-fg brightred
set -g mode-bg colour235
set -g mode-attr bold
# Visuals
set -g visual-activity off # Notify events in monitor-activity enabled windows
set -g visual-bell off # Notify bell
set -g visual-silence off
# Clock
set -g clock-mode-colour brightred # Clock colour (C-t)
set -g clock-mode-style 24 # 12 / 24
# Status line
set -g status on
set -g status-position bottom
set -g status-justify left # left, right, centr
set -g status-interval 1 # Status refresh interval (s)
set -g status-bg colour235
set -g status-fg default
# Left status
set -g status-left-length 20
set -g status-left-bg colour235
set -g status-left-fg default
set -g status-left '' # '#(whoami):#S:#P '
# Right status
set -g status-right-length 50
set -g status-right-bg colour235
set -g status-right-fg default
set -g status-right ' #S:#I:#P #[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S '
# Window status
set -g window-status-separator ''
set -g window-status-bg colour239
set -g window-status-fg default
set -g window-status-current-bg colour242
set -g window-status-current-fg default
set -g window-status-format ' #[fg=colour245]#I:#[fg=colour233,bold]#W#[fg=colour245]#F '
set -g window-status-current-format ' #I#[fg=colour245]:#[fg=colour233,bold]#W#[fg=brightred]#F '
############################################
#### Bindings ##############################
############################################
bind r source-file ~/.tmux.conf # Reload tmux config
bind * list-clients # List connected clients
# Sessions
bind Q confirm-before 'kill-session' # Kill active session
# windows
bind A command-prompt 'rename-window %%' # Rename window
bind '"' choose-window # Select window from list
bind ' ' next-window # Go to next window
bind BSpace previous-window # Go to previous window
# Panes
bind @ next-layout # Toggle default pane layouts
bind '`' display-panes # Enumerate panes
bind -n M-b last-pane # Toggle last pane
# Kill active pane / window
# bind k confirm-before -p "kill-pane #P? (y/n)" "kill-pane"
# bind K confirm-before -p "kill-window #I? (y/n)" "kill-window"
# Remap prefix to C-a (screen like)
# unbind C-b
# set -g prefix C-a
# bind C-a send-prefix
# Switch panes using Tab or Alt-n and Alt-p
bind Tab select-pane -t:.+
bind BTab select-pane -t:.-
# bind M-n select-pane -t:.+
# bind M-p select-pane -t:.-
# Split panes using | and _ or v and s
bind | split-window -h
bind _ split-window -v
bind v split-window -h
bind s split-window -v
# Resize panes using Vim keys
bind h resize-pane -L 1
bind j resize-pane -D 1
bind k resize-pane -U 1
bind l resize-pane -R 1
# Resize panes using <, >, - and +
bind < resize-pane -L 5 # Resize width to the left
bind > resize-pane -R 5 # Resize width to the right
bind - resize-pane -D 5 # Resize height down
bind + resize-pane -U 5 # Resize height up
# Switch panes using Shift-vim keys
bind H select-pane -L
bind J select-pane -D
bind K select-pane -U
bind L select-pane -R
# Switch panes using Alt-vim keys without prefix
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# Switch panes using Alt-arrow keys without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Switch windows using Shift-arrow
bind -n S-Left previous-window
bind -n S-Right next-window
# Switch windows using Alt-num keys without prefix
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3
bind -n M-4 select-window -t 4
bind -n M-5 select-window -t 5
bind -n M-6 select-window -t 6
bind -n M-7 select-window -t 7
bind -n M-8 select-window -t 8
bind -n M-9 select-window -t 9
bind -n M-0 select-window -t 10 # set to 0 if base-index === 0
# Copy mode
# bind -t vi-copy 'v' begin-selection # Begin selection in copy mode
# bind -t vi-copy 'C-v' rectangle-toggle # Begin rectangle selection in copy mode
# bind -t vi-copy 'y' copy-selection # Yank selection in copy mode
# Split horizontally with CWD
# bind _ run-shell 'tmux split-window -v "cd \"$(tmux display -p "\$TMUXPWD_#D" | tr -d %)\"; exec $SHELL"'
# bind | run-shell 'tmux split-window -h "cd \"$(tmux display -p "\$TMUXPWD_#D" | tr -d %)\"; exec $SHELL"'
# Join window/pane to this window. The oposite of 'C-b !'.
# bind @ command-prompt -p "create pane from:" "join-pane -s ':%%'"
# Toggle activity monitoring for the current window.
# bind M setw monitor-activity
# Copy tmux paste buffer to clipboard
# bind C-c run 'tmux show-buffer | xclip -i -selection clipboard' \; display-message 'Copied tmux buffer to X clipboard.'
# Copy clipboard to tmux paste buffer and paste tmux paste buffer
# bind C-v run 'tmux set-buffer -- \'$(xclip -o -selection clipboard)\'; tmux paste-buffer'