summaryrefslogtreecommitdiffstats
path: root/regress/conf/ed08995f38b5a3079262a88d2563abe4.conf
blob: a0fd150069bbdd41594d298f9e9cc779d749d33f (plain)
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
#---------------------------------------------------------------------------#
# .tmux.conf
# Helmut K. C. Tessarek, Last update 2018-10-16
#---------------------------------------------------------------------------#

#---------------------------------------------------------------------------#
# set prefix key to ctrl+a / ctrl-b is used in vi for going back one page
#---------------------------------------------------------------------------#
unbind C-b
set -g prefix C-a

#---------------------------------------------------------------------------#
# send the prefix to client inside window (nested sessions)
#---------------------------------------------------------------------------#
bind-key a send-prefix

#---------------------------------------------------------------------------#
# toggle last window like screen
#---------------------------------------------------------------------------#
bind-key C-a last-window

#---------------------------------------------------------------------------#
# start window indexing at one instead of zero
#---------------------------------------------------------------------------#
#set -g base-index 1

#---------------------------------------------------------------------------#
# default terminal - we want 256 colors !!!
#---------------------------------------------------------------------------#
set -g default-terminal "screen-256color"

#---------------------------------------------------------------------------#
# on-screen time for status messages in ms
#---------------------------------------------------------------------------#
set -g display-time 2000

#---------------------------------------------------------------------------#
# on-screen time for display-panes in ms
#---------------------------------------------------------------------------#
set -g display-panes-time 2000

#---------------------------------------------------------------------------#
# color for display pane indicator
#---------------------------------------------------------------------------#
set -g display-panes-colour "cyan"
#set -g display-panes-active-colour "#0087ff"
#set -g display-panes-active-colour "red"

#---------------------------------------------------------------------------#
# open a man page in new window
#---------------------------------------------------------------------------#
unbind m
bind m command-prompt "split-window 'exec man %%'"

#---------------------------------------------------------------------------#
# quick view of processes
#---------------------------------------------------------------------------#
#bind '~' split-window "exec htop"

#---------------------------------------------------------------------------#
# scrollback buffer n lines
#---------------------------------------------------------------------------#
set -g history-limit 5000

#---------------------------------------------------------------------------#
# toggle status bar
#---------------------------------------------------------------------------#
unbind b
bind-key b set-option status

#---------------------------------------------------------------------------#
# resize panes like vim
# feel free to change the "1" to however many lines you want to resize by,
# only one at a time can be slow
#---------------------------------------------------------------------------#
unbind <
unbind >
unbind -
unbind +
bind -r < resize-pane -L 1
bind -r > resize-pane -R 1
bind -r - resize-pane -D 1
bind -r + resize-pane -U 1

#---------------------------------------------------------------------------#
# toggle mouse helpers
#---------------------------------------------------------------------------#
unbind Enter
unbind C-m
bind C-m set-option mouse \; display-message 'mouse -> #{?mouse,on,off}'

#---------------------------------------------------------------------------#
# Reload config file
#---------------------------------------------------------------------------#
unbind R
bind-key R source-file ~/.tmux.conf \; display-message "Reloading configuration done"

#---------------------------------------------------------------------------#
# start ssh session in new window
#---------------------------------------------------------------------------#
unbind S
bind-key S command-prompt "new-window -n %1 'ssh %1'"

#---------------------------------------------------------------------------#
# start new session
#---------------------------------------------------------------------------#
unbind C
bind-key C command-prompt "new-session -s %1"

#---------------------------------------------------------------------------#
# Keys to switch session
#---------------------------------------------------------------------------#
bind Q switchc -t0
bind W switchc -t compile
bind E switchc -t config

#---------------------------------------------------------------------------#
# break pane in background
#---------------------------------------------------------------------------#
unbind '@'
bind '@' break-pane -d

#---------------------------------------------------------------------------#
# join pane with target window
#---------------------------------------------------------------------------#
unbind ^
bind ^ command-prompt "join-pane -t %1"

#---------------------------------------------------------------------------#
# move around panes with hjkl, as one would in vim after pressing ctrl-w
#---------------------------------------------------------------------------#
#bind h select-pane -L
#bind j select-pane -D
#bind k select-pane -U
#bind l select-pane -R

#---------------------------------------------------------------------------#
# bind : to command-prompt like vim
# this is the default in tmux already
#---------------------------------------------------------------------------#
bind : command-prompt

#---------------------------------------------------------------------------#
# Remain on exit
#---------------------------------------------------------------------------#
#setw -g remain-on-exit on

#---------------------------------------------------------------------------#
# vi-style controls for copy mode
#---------------------------------------------------------------------------#
setw -g mode-keys vi

#---------------------------------------------------------------------------#
# Make mouse useful in copy mode
#---------------------------------------------------------------------------#
#setw -g mode-mouse on

#---------------------------------------------------------------------------#
# More straight forward key bindings for splitting
#---------------------------------------------------------------------------#
unbind %
unbind v
#bind | split-window -h
bind v split-window -h
unbind '"'
unbind h
#bind - split-window -v
bind h split-window -v

#---------------------------------------------------------------------------#
# Synchronize panes
#---------------------------------------------------------------------------#
unbind y
bind y set-window-option synchronize-panes \; display-message 'synchronize-panes -> #{?synchronize-panes,on,off}'

#---------------------------------------------------------------------------#
# Other key codes: Tab, BTab, Escape
#---------------------------------------------------------------------------#

#---------------------------------------------------------------------------#
# Clock
#---------------------------------------------------------------------------#
setw -g clock-mode-colour green
setw -g clock-mode-style 24

#---------------------------------------------------------------------------#
# Terminal emulator window title
#---------------------------------------------------------------------------#
set -g set-titles on
set -g set-titles-string '#S:#I.#P #W'

#---------------------------------------------------------------------------#
# Status Bar
#---------------------------------------------------------------------------#
set -g status-bg black
set -g status-fg white
set -g status-interval 1
set -g status-left-length 30
set -g status-left '#[fg=green]#h#[default] '
#set -g status-right '#[fg=yellow]#(cut -d " " -f 1-4 /proc/loadavg)#[default] #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]'
#set -g status-right '#[fg=yellow,bold]%Y-%m-%d %H:%M#[default]'
set -g status-right '#[fg=yellow]%Y-%m-%d %H:%M %Z#[default]'
#set -g status-justify center
#set -g status-keys vi

set -g allow-rename off
setw -g automatic-rename on

#---------------------------------------------------------------------------#
# Highlighting the active window in status bar
#---------------------------------------------------------------------------#
#setw -g window-status-current-bg red
set-option -g window-status-format "#I:#W#F#{?pane_synchronized,S,}"
set-window-option -g window-status-current-format "#{?pane_synchronized,#[bg=red],}#{?window_zoomed_flag,#[bg=colour130],}#I:#W#F#{?pane_synchronized,S,}"
set-option -g window-status-current-style bg=blue

#---------------------------------------------------------------------------#
# global update environment
#---------------------------------------------------------------------------#
set -g update-environment "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TZ"

#---------------------------------------------------------------------------#
# settings for AIX
# terminal overrides to enable colors
# set default terminal to vt100 or xterm (screen does not exist on AIX)
#---------------------------------------------------------------------------#
if-shell "uname|grep AIX" 'set -g terminal-overrides "xterm*:XT,xterm*:setab=\\E[4%p1%dm,xterm*:setaf=\\E[3%p1%dm"'
#if-shell "uname|grep AIX" "set -g default-terminal vt100"
if-shell "uname|grep AIX" "set -g default-terminal xterm"

#---------------------------------------------------------------------------#
# settings for macOS
#---------------------------------------------------------------------------#
if-shell "uname|grep Darwin" 'set -g default-command "/bin/bash -l"'

#---------------------------------------------------------------------------#
# Pane coloring
# set inactive/active window styles
#---------------------------------------------------------------------------#
set -g window-style "fg=colour247,bg=colour234"
set -g window-active-style "fg=colour250,bg=black"
set -g @TPCS "1"

#---------------------------------------------------------------------------#
# pane border - different style / use cyan
#---------------------------------------------------------------------------#
#set -g pane-border-bg colour235
#set -g pane-border-fg colour238
#set -g pane-active-border-bg colour234
#set -g pane-active-border-fg colour51

#---------------------------------------------------------------------------#
# toggle pane coloring on/off
#---------------------------------------------------------------------------#
unbind C-b
bind C-b if -F '#{@TPCS}' \
	'set -g window-style "fg=default,bg=default" ; set -g window-active-style "fg=default,bg=default" ; set -g @TPCS "0"; display-message "Pane coloring -> off"' \
	'set -g window-style "fg=colour247,bg=colour234" ; set -g window-active-style "fg=colour250,bg=black" ; set -g @TPCS "1"; display-message "Pane coloring -> on"'

#---------------------------------------------------------------------------#
# List of plugins
#---------------------------------------------------------------------------#
set -g @plugin 'tmux-plugins/tpm'
#set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-logging'

set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-save-bash-history 'on'

set -g @logging-path $HOME
set -g @screen-capture-path $HOME
set -g @save-complete-history-path $HOME

# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'

#---------------------------------------------------------------------------#
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
#---------------------------------------------------------------------------#
run '~/.tmux/plugins/tpm/tpm'