-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.tmux.conf
More file actions
200 lines (158 loc) · 7.1 KB
/
.tmux.conf
File metadata and controls
200 lines (158 loc) · 7.1 KB
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
# ============================================================
# ~/.tmux.conf
# ============================================================
# ============================================================
# COLOR PALETTE REFERENCE
# tmux can't reliably expand user variables inside #[fg=] style
# strings, so colors are inlined below. This block is the
# single source of truth — update here, then grep-replace below.
#
# bg_base #121212 main background
# bg_dark #070707 inactive pane bg
# bg_active #151515 active pane bg
# muted #333333 borders, dim text
#
# cyan #81b9d4 user / active window / borders
# purple #c9a4e0 claude segment
# green #a3be8c kernel / hostname
# orange #d08770 network
# blue #5e81ac battery
# snow #d8dee9 clock
#
# sb_purple #3b2e4a claude segment bg
# sb_blue #1e3040 user / active-window segment bg
# sb_green #2a2e1e kernel segment bg
# sb_orange #2e2215 network segment bg
# sb_teal #1e2e1e hostname segment bg
# sb_navy #1e2535 battery segment bg
# sb_clock #252525 clock segment bg
# ============================================================
# ============================================================
# VERSION-SPECIFIC COMPATIBILITY
# ============================================================
run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | grep -ioP '(\\d+\\.\\d+)')"
# mouse: pre-2.1 had 4 separate options
if-shell -b '[ "$(echo "$TMUX_VERSION == 2.1" | bc)" = 1 ]' \
"set -g mouse-select-pane on; set -g mode-mouse on; \
set -g mouse-resize-pane on; set -g mouse-select-window on"
if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.1" | bc)" = 1 ]' \
"set -g mouse on"
# UTF8 autodetected in 2.2+
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.2" | bc)" = 1 ]' \
"set utf8 on; set -g status-utf8 on; set -g mouse-utf8 on"
# copy-mode keybinds changed in 2.4
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.4" | bc)" = 1 ]' \
"bind-key -t vi-copy v begin-selection; \
bind-key -t vi-copy V send -X select-line; \
bind-key -t vi-copy C-v rectangle-toggle; \
bind-key -t vi-copy y copy-pipe 'xclip -selection clipboard -in'"
if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.4" | bc)" = 1 ]' \
"set -g mode-keys vi; \
bind-key -T copy-mode-vi v send -X begin-selection; \
bind-key -T copy-mode-vi V send -X select-line; \
bind-key -T copy-mode-vi C-v send -X rectangle-toggle; \
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel 'xclip -selection clipboard -in'"
# ============================================================
# COLORS
# ============================================================
# Messages / command prompt
set -g message-style "fg=#81b9d4,bg=#121212"
# Panes
set -g window-style "fg=#AAAAAA,bg=#070707"
set -g window-active-style "fg=#CCCCCC,bg=#151515"
set -g pane-border-style "fg=#333333"
set -g pane-active-border-style "fg=#81b9d4,bg=#151515"
# Pane number display (prefix-q)
set -g display-panes-colour '#333333'
set -g display-panes-active-colour '#81b9d4'
# Copy/selection mode highlight
set -g mode-style "bg=#81b9d4,fg=#121212"
# Clock (prefix-t)
set -g clock-mode-colour '#a3be8c'
# Status bar base
set -g status-style "fg=#AAAAAA,bg=#121212"
# Window tabs — inactive
set -g window-status-style "fg=#888888,bg=#121212"
set -g window-status-format ' #I:#W#F '
# Window tabs — active (muted blue block, matches status-right style)
set -g window-status-current-style "fg=#81b9d4,bg=#1e3040,bold"
set -g window-status-current-format '#{?pane_synchronized,#[bg=#5a4a00]#[fg=#f0c040], }#I:#W#F '
# Window bell / activity alerts
set -g window-status-bell-style "fg=#d08770,bg=#121212,bold"
set -g window-status-activity-style "fg=#d8dee9,bg=#2e2215"
# ============================================================
# STATUS BAR CONTENT
# ============================================================
set -g status-interval 30
set -g status-right-length 300
set -g status-left-length 20
set -g status-left ' #S '
set -g status-right "\
#[bg=#3b2e4a,fg=#c9a4e0]#(~/.local/bin/claude-status.sh)\
#[bg=#1e3040,fg=#81b9d4] 👤 #(whoami) \
#[bg=#2a2e1e,fg=#a3be8c] 🐧 #(uname -r) \
#[bg=#2e2215,fg=#d08770] 🌐 #(ip -4 a | awk '/inet / && !/127\\.0\\.0/ && !/172\\.1[6-9]\\./ && !/172\\.2[0-9]\\./ && !/172\\.3[01]\\./ {gsub(/\\/.*/, \"\", $2); print $2; exit}') \
#[bg=#1e2e1e,fg=#a3be8c] 💻 #H \
#[bg=#1e2535,fg=#5e81ac]#(~/.local/bin/battery-icon.sh)\
#[bg=#252525,fg=#d8dee9] 🕓 #(date '+%D %r') "
# ============================================================
# STATUS BAR TOGGLES
# ============================================================
bind-key C run 'v=$(tmux showenv -g TMUX_SHOW_CLAUDE | cut -d= -f2); [ "$v" = 1 ] && tmux setenv -g TMUX_SHOW_CLAUDE 0 || tmux setenv -g TMUX_SHOW_CLAUDE 1; rm -f ~/.claude/.status-cache; tmux refresh-client -S'
bind-key B run 'v=$(tmux showenv -g TMUX_SHOW_BATTERY | cut -d= -f2); [ "$v" = 1 ] && tmux setenv -g TMUX_SHOW_BATTERY 0 || tmux setenv -g TMUX_SHOW_BATTERY 1; tmux refresh-client -S'
# ============================================================
# GENERAL SETTINGS
# ============================================================
set -g default-terminal "tmux-256color"
set -g prefix M-a
set -g base-index 1
set -g pane-base-index 1
set -g renumber-windows on
set -g aggressive-resize on
set -s escape-time 0
set -g display-time 3000
# ============================================================
# KEY BINDINGS
# ============================================================
bind-key M-a last-window
bind-key a send-prefix
# Toggle status bar
bind-key -n C-Space set-option status
# Clear scrollback
bind -n C-k clear-history
# Splits
unbind %
bind | split-window -h
bind - split-window -v
# New named window
bind c command-prompt -p "Name: " "new-window -n %1"
# Pane navigation (hjkl)
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Pane resize (Alt + hjkl)
bind -n M-h resize-pane -L 1
bind -n M-l resize-pane -R 1
bind -n M-k resize-pane -U 1
bind -n M-j resize-pane -D 1
# Pane join/send
bind-key r command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key o command-prompt -p "send pane to:" "join-pane -t '%%'"
# Sync panes toggle
bind y set synchronize-panes\; display 'synchronize-panes #{?synchronize-panes,on,off}'
# Monitor activity toggle
bind m set monitor-activity
# Paste from clipboard
bind M-v run "tmux set-buffer -- \"$(xclip -o -selection clipboard)\"; tmux paste-buffer"
# ============================================================
# PLUGINS (TPM)
# Keep at the very bottom
# ============================================================
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'on'
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
run '~/.tmux/plugins/tpm/tpm'