-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
208 lines (164 loc) · 8.35 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
# Brandon Thomas' tmux configs.
set -g default-terminal "screen-256color"
set -g history-limit 1000000 # Much history.
set -s escape-time 0 # Vim escape cannot be laggy!
set -g repeat-time 1000
# Vim mode
# Check out the "vi-copy" key table with `:list-keys -t vi-copy`
setw -g mode-keys vi
# For terminals that support mouse events
set -g mouse on
# Untrain thyself of `prefix -> navigation -> repeat` loops.
unbind-key j
unbind-key k
unbind-key h
unbind-key l
unbind-key ? # Unbind default list-keys
bind-key p paste-buffer
# (Re-)Source the tmux.conf!
# The binding `s` was previously choose-tree
bind r source-file ~/.tmux.conf \; display "Reloaded tmux.conf!"
bind s source-file ~/.tmux.conf \; display "Reloaded tmux.conf!"
# Clear the scrollback buffer (Yay!)
# The binding `C-q` previously displayed the pane number (kind of useful...)
bind C-q send-keys -R \; clear-history \; display "clear-history"
bind -n C-q send-keys -R \; clear-history \; display "clear-history"
# Edit configuration
bind v new-window 'vi ~/.tmux.conf'
# Change help / list-keys
bind-key h list-keys
# Search Up and Down (instantly!)
bind-key / copy-mode \; send-keys /
bind-key ? copy-mode \; send-keys ?
# When multiple terminals are attached to the same session, don't let the
# smallest terminal resize all of the sessions. Limit to window level instead.
set-window-option -g aggressive-resize on
# ---------------------------
# KEY BINDINGS
# ---------------------------
# Existing bindings:
# Detatch session: d
# Rename current session: $
# Rename current window: ,
# Swap current pane with previous: {
# Swap current pane with next: }
bind-key x confirm-before 'kill-pane' # already default
bind-key X confirm-before 'kill-window'
bind-key C-X confirm-before 'kill-session'
bind-key C-X confirm-before 'kill-session'
# Navigate without gnarly prefix key
bind -n C-j select-pane -t :.+ # TODO: Temporary. Conflicts with vim.
bind -n C-k select-pane -t :.- # TODO: Temporary. Conflicts with vim.
bind -n C-n select-window -n
bind -n C-p select-window -p
# Common layouts (use C-b <Space> to cycle all presets)
# Replaces "select window" bindings, 0-9
bind-key Space select-layout even-horizontal # Normally next-layout
bind-key C-space next-layout
# This was just `split-window`; now we do a re-layout.
bind-key '"' split-window \; select-layout even-horizontal
bind-key D detach-client # Detach
bind-key T choose-tree # Menu to switch sessions.
# And indexed...
bind-key ` select-layout tile
bind-key 1 select-layout even-horizontal
bind-key 2 select-layout even-vertical
bind-key 3 select-layout main-horizontal
bind-key 4 select-layout main-vertical
bind-key 5 select-layout tiled
# Pane resizing with HJKL
bind H resize-pane -L 15
bind J resize-pane -D 15
bind K resize-pane -U 15
bind L resize-pane -R 15
# Display large visable indicators
bind-key t clock-mode # Large clock
bind-key w display-panes # Pane indices (unique, auto-increment)
# Toggle synchronization (mnemonic: e is for echo
# From https://github.com/tangledhelix/dotfiles/blob/master/tmux.conf
bind e setw synchronize-panes on \; display "Synchronize panes ON (E: off)"
bind E setw synchronize-panes off \; display "Synchronize panes OFF (e: on)"
# ---------------------------
# LAYOUT / STYLE
# ---------------------------
# Monokai is best theme.
# Adapted from: https://github.com/ZachMassia/dotfiles/blob/master/tmux.conf
# Monokai/Molokai hex colors.
# http://www.colourlovers.com/lover/Monokai/colors
# cyan - #00b9d7
# gold/brown - #abaa98
# green - #82cdb9
# off-white #f5f5f5
# orange - #f37259
# pink - #ff3d70
# pink/magenta - #f7208b
# yellow - #f9f5c2
# Status bar position
set-option -g status-position top
# Denote window activity
set-window-option -g monitor-activity on
# set-window-option -g window-status-activity-attr none NB(2022.11.12): Broken option
# Clock
set-window-option -g clock-mode-style 24
set-window-option -g clock-mode-colour colour187 # monokai yellow
# Status Bar Left
set -g status-left '#[fg=colour187][#{session_name}] #I:#P | ' # requires color
set -g status-left-length 70
# NB(2022.11.12): Many of these colors are no longer valid names. Unsure when these broke.
# Status Bar Colors
# set-option -g status-attr dim # NB(2022.11.12): Broken color option
set-option -g status-bg colour237 # slightly brighter than molokai vim tabs
set-option -g status-fg colour187 # monokai yellow
# Window Title Tab Colors
# set-window-option -g window-status-attr dim # NB(2022.11.12): Broken color option
# set-window-option -g window-status-bg colour237 # brighter gray # NB(2022.11.12): Broken color option
# set-window-option -g window-status-fg colour187 # monokai yellow # NB(2022.11.12): Broken color option
# set-window-option -g window-status-current-attr dim # NB(2022.11.12): Broken color option
# set-window-option -g window-status-current-bg colour161 # monokai pink # NB(2022.11.12): Broken color option
# set-window-option -g window-status-current-fg '#000000' # NB(2022.11.12): Broken color option
# set-window-option -g window-status-current-bg '#000000' # NB(2022.12.12): Broken color option
# set-window-option -g window-status-current-fg colour161 # monokai pink # NB(2022.11.12): Broken color option
# NB(2022.11.12): Many of these colors are no longer valid names. Unsure when these broke.
# Pane Border Colors
# set-option -g pane-active-border-bg '#101010' # NB(2022.11.12): Broken color option
# set-option -g pane-active-border-fg '#87d700' # monokai-green # NB(2022.11.12): Broken color option
# set-option -g pane-border-bg '#101010' # NB(2022.11.12): Broken color option
# set-option -g pane-border-fg '#505050' # NB(2022.11.12): Broken color option
# NB(2022.11.12): The previous comment on the following colors was "Not sure what these are", and
# the comment itself is years old. Many of these options are broken, so they've been commented out.
# set-option -g mode-bg '#000000' # NB(2022.11.12): Broken color option
# set-option -g mode-fg colour187 # monokai yellow # NB(2022.11.12): Broken color option
# set-option -g message-bg '#000000' # NB(2022.11.12): Broken color option
# set-option -g message-fg colour187 # monokai yellow # NB(2022.11.12): Broken color option
# Set CWD as names
# https://stackoverflow.com/a/37136828
# Modified to show the current window name, or the running process if a name is not set.
set-window-option -g window-status-current-format '#[fg=white,bold]** #{window_index} #[fg=green]#([[ ! -z "#{window_name}" ]] && echo "#{window_name}" || echo #{pane_current_command}) #[fg=colour200]#(echo "#{pane_current_path}" | rev | cut -d'/' -f-3 | rev) #[fg=white]**|'
set-window-option -g window-status-format '#[fg=white,bold]#{window_index} #[fg=colour84]#([[ ! -z "#{window_name}" ]] && echo "#{window_name}" || echo #{pane_current_command}) #[fg=colour219]#(echo "#{pane_current_path}" | rev | cut -d'/' -f-3 | rev) #[fg=white]|'
set-option -g status-interval 1
# Modal "scrollbar" cursor position
setw -g mode-style 'fg=colour187 bg=colour237 bold'
# Status Bar Window Title Tabs
set -g status-justify left # justify the window tabs
set -g status-left-length 20
set -g status-position top
set -g status-right-length 50
set -g status-style 'bg=colour237 fg=colour187' # bg: gray, fg: monokai yellow
# Window titles
setw -g window-status-style 'bg=colour237 fg=colour187' # bg: gray, fg: monokai yellow
setw -g window-status-current-style 'bg=colour232 fg=colour161' # bg: black, fg: monokai pink
# Pane delimiters
set -g pane-border-style 'bg=colour0 fg=colour187'
set -g pane-active-border-style 'bg=colour0 fg=colour200'
# Messages
set -g message-style 'bg=colour200 fg=colour232 bold'
# ---------------------------
# DYNAMIC WINDOW NAMING
# ---------------------------
# Set CWD as names
# https://stackoverflow.com/a/37136828
# Modified to show the current window name, or the running process if a name is not set.
setw -g window-status-current-format '#[fg=white,bold]** #{window_index} #[fg=green]#([[ ! -z "#{window_name}" ]] && echo "#{window_name}" || echo #{pane_current_command}) #[fg=colour200]#(echo "#{pane_current_path}" | rev | cut -d'/' -f-3 | rev) #[fg=white]**|'
setw -g window-status-format '#[fg=white,bold]#{window_index} #[fg=colour84]#([[ ! -z "#{window_name}" ]] && echo "#{window_name}" || echo #{pane_current_command}) #[fg=colour219]#(echo "#{pane_current_path}" | rev | cut -d'/' -f-3 | rev) #[fg=white]|'
set -g status-interval 1