-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
266 lines (193 loc) · 8.2 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
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
# tmux.conf
# vim: ft=cfg
# __| \ _ \ | _ \ __| __ __| __ __|
# ( _ \ / | ( | (_ | | |
# \___| _/ _\ _|_\ ____| \___/ \___| _| _|
# ----------------
# General Settings
# ----------------
# Reload config file (change file location to your the tmux.conf you want to use)
bind-key r source-file "${HOME}/.config/tmux/tmux.conf"
# Set the command used for new windows
set-option -g default-command "${SHELL}"
# Set default terminal
set-option -sg default-terminal "screen-256color"
# Allow terminal scrolling
set-option -ga terminal-overrides "xterm*:smcup@:rmcup@"
set-option -ga terminal-overrides "xterm-256color*:RGB"
# Set the maximum number of lines held in window history
set-option -g history-limit 1000000
# Set the time for which status line messages are displayed. If 0, messages are displayed until a key is pressed
set-option -g display-time 0
# Enable mouse control (clickable windows, panes, resizable panes)
set-option -g mouse on
# Remap prefix from 'C-B' to 'C-A' ONLY if not in a remote host
if-shell '[ -z "${SSH_TTY}" ]' {
unbind-key C-b
bind-key C-a send-prefix
set-option -g prefix C-a
}
# Kill session
bind-key Q confirm-before -p "kill-session #S? (y/n)" kill-session
# ------
# Window
# ------
# Window navigation move left
bind-key -r H previous-window
unbind-key p
# Window navigation move right
bind-key -r L next-window
unbind-key n
# ----
# Pane
# ----
# Split pane vertically using v like in vim
bind-key v split-window -h
unbind-key %
# Split pane horizontally using s like in vim
bind-key s split-window -v
unbind-key '"'
# Pane navigation move left
bind-key h select-pane -L
# Pane navigation move down
bind-key j select-pane -D
# Pane navigation move up
bind-key k select-pane -U
# Pane navigation move right
bind-key l select-pane -R
# Pane resize left
bind-key -r Left resize-pane -L 3
# Pane resize down
bind-key -r Down resize-pane -D 3
# Pane resize up
bind-key -r Up resize-pane -U 3
# Pane resize right
bind-key -r Right resize-pane -R 3
# ----------
# Status Bar
# ----------
# Set the maximum length for the status line
set-option -g status-left-length 150
set-option -g status-right-length 170
# Update the status bar every X seconds
set-option -g status-interval 2
# Start windows and panes index at 1, not 0
set-option -g base-index 1
set-option -wg pane-base-index 1
# Windows to always renumber when one is killed
set-option -g renumber-windows on
# Add empty line above the status bar
# set-option -g status 2
# set-option -Fg status-format[1] "#{status-format[0]}"
# set-option -g status-format[0] ""
# -----------------------
# Status Bar Color Schema
# -----------------------
# ALL disabled as using catppuccin at the bottom of this file
# Set status bar color schema
# set-option -g status-style 'bg=default'
# set-option -g status-fg "#c8c6c6"
# Highlight active window
# set-option -g window-status-current-format '#[fg=green]#I:#W#F'
# Show P in red if the prefix has been pressed
# set-option -g status-left '#{?client_prefix,#[bg=red fg=black bold],}P#[default] [#{session_name}] '
# -----------------------------------------
# Notification of activity in other windows
# -----------------------------------------
# If on, display a message instead of sending a bell when activity occurs
set-option -wg monitor-activity on
set-option -g visual-activity off
# If on, a message is shown on a bell in a window instead of it being passed through to the terminal (which normally makes a sound)
set-option -wg monitor-bell on
set-option -g visual-bell off
# If on, prints a message after the interval has expired on a given window instead of sending a bell
set-option -wg monitor-silence 0
set-option -g visual-silence off
# ------------
# Copy & Paste
# ------------
# Access copy mode without prefix
# bind-key -T root [ copy-mode
# Use vim keybindings in copy mode
set-option -wg mode-keys vi
# Set 'v' to begin selection as in Vim
bind-key -T copy-mode-vi 'v' send -X begin-selection
# Set 'y' to copy selection as in Vim
bind-key -T copy-mode-vi 'y' send -X copy-selection
# Disable mouse feature drag and copy
unbind-key -T copy-mode-vi MouseDragEnd1Pane
# Double click to select word
bind-key -T root DoubleClick1Pane copy-mode \; send-keys -X select-word
bind-key -T copy-mode-vi DoubleClick1Pane send -X select-word
# -----------------
# Plugin Catppuccin
# -----------------
# Catppuccin theme
set-option -g @catppuccin_flavor "mocha"
set-option -g @catppuccin_status_background "none"
set-option -g @catppuccin_window_status "text"
set-option -g @catppuccin_window_status_style "custom"
set-option -g @catppuccin_window_left_separator "#[reverse]#[noreverse]"
set-option -g @catppuccin_window_middle_separator "#[reverse]#[noreverse]"
set-option -g @catppuccin_window_right_separator ""
set-option -g @catppuccin_window_number_position "left"
set-option -g @catppuccin_window_flags "text"
set-option -g @catppuccin_window_text "#[bg=default] #{?#{!=:#{window_name},},#{window_name},} "
set-option -g @catppuccin_window_number "#I"
set-option -g @catppuccin_window_text_color "#{@thm_surface_0}"
set-option -g @catppuccin_window_number_color "#{@thm_overlay_2}"
set-option -g @catppuccin_window_current_text "#[bg=default] #{?#{!=:#{window_name},},#{window_name},} "
set-option -g @catppuccin_window_current_number "#I"
set-option -g @catppuccin_window_current_text_color "#{@thm_surface_1}"
set-option -g @catppuccin_window_current_number_color "#{@thm_mauve}"
set-option -g @catppuccin_status_left_separator ""
set-option -g @catppuccin_status_middle_separator "#[reverse]#[noreverse]"
set-option -g @catppuccin_status_right_separator " "
set-option -g @catppuccin_status_connect_separator "no"
set-option -g @catppuccin_status_fill "icon"
set-option -g @catppuccin_status_module_bg_color "default"
# Override the specific modules info
set-option -g @catppuccin_session_icon "#{?client_prefix,S PREFIX,#{?#{==:#{pane_mode},copy-mode},S COPY,S}}"
set-option -g @catppuccin_session_color "#{?client_prefix,#{E:@thm_red},#{?#{==:#{pane_mode},copy-mode},#{E:@thm_yellow},#{E:@thm_green}}}"
set-option -g @catppuccin_session_text " #S "
set-option -g @catppuccin_user_icon "U"
set-option -g @catppuccin_user_color "#{E:@thm_sky}"
set-option -g @catppuccin_host_icon "H"
set-option -g @catppuccin_host_color "#{E:@thm_lavender}"
set-option -g @catppuccin_date_time_icon "D"
set-option -g @catppuccin_date_time_color "#{E:@thm_maroon}"
set-option -g @catppuccin_uptime_icon "T"
set-option -g @catppuccin_uptime_color "#{E:@thm_pink}"
set-option -g @catppuccin_carlogtt_cpu_icon "C"
set-option -g @catppuccin_carlogtt_memory_icon "M"
set-option -g @catppuccin_carlogtt_mw_cookie_icon "MW"
set-option -g @catppuccin_carlogtt_mw_cookie_color "#{E:@thm_rosewater}"
# RUN Catppuccin
run-shell "~/.config/tmux/plugins/catppuccin/catppuccin.tmux"
# Load custom modules
source -F "#{d:current_file}/plugins/catppuccin/status/carlogtt_cpu.conf"
source -F "#{d:current_file}/plugins/catppuccin/status/carlogtt_memory.conf"
source -F "#{d:current_file}/plugins/catppuccin/status/carlogtt_mw_cookie.conf"
# Set the order for the status line
set-option -g status-left "#{E:@catppuccin_status_session}"
set-option -g status-right "#{E:@catppuccin_status_user}#{E:@catppuccin_status_host}#{E:@catppuccin_status_date_time}#{E:@catppuccin_status_uptime}"
set-option -agF status-right "#{E:@catppuccin_status_carlogtt_mw_cookie}#{E:@catppuccin_status_carlogtt_cpu}#{E:@catppuccin_status_carlogtt_memory}"
# These lines must stay at the end because they get overwritten by catppuccin theme
# Add empty line above the status bar
set-option -g status 2
set-option -Fg status-format[1] "#{status-format[0]}"
set-option -g status-format[0] ""
# -----------------
# Plugin fzf-url
# -----------------
set-option -g @fzf-url-bind 'u'
set-option -g @fzf-url-history-limit '600'
# Open tmux-fzf-url in a tmux popup
set-option -g @fzf-url-fzf-options "--tmux bottom,40% --border --color header:italic --header 'ENTER on link to open in browser'"
# -----------
# RUN Plugins
# -----------
run-shell "~/.config/tmux/plugins/tmux-cpu/cpu.tmux"
run-shell "~/.config/tmux/plugins/tmux-midway/midway.tmux"
run-shell "~/.config/tmux/plugins/tmux-resurrect/resurrect.tmux"
run-shell "~/.config/tmux/plugins/tmux-fzf-url/fzf-url.tmux"