-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.tmux.conf
More file actions
144 lines (115 loc) · 5.08 KB
/
Copy path.tmux.conf
File metadata and controls
144 lines (115 loc) · 5.08 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
# Tim's tmux configuration
# Set zsh as default shell (auto-detect path)
set-option -g default-shell /bin/zsh
set-option -g default-command /bin/zsh
# Mouse support
set -g mouse on
# Colors and terminal compatibility
set -g default-terminal "tmux-256color"
set -g allow-passthrough all
# Terminal overrides for Ghostty and modern terminals
# Include xterm:Tc for SSH sessions where TERM gets downgraded
set -ga terminal-overrides ",xterm-ghostty:Tc,xterm-256color:Tc,tmux-256color:Tc,xterm:Tc"
# Enable hyperlinks (OSC 8) - allows Cmd+click on URLs in Ghostty
set -ga terminal-features ",xterm-ghostty:hyperlinks"
# Forward modified keys (e.g. Shift+Enter) to terminal apps
set -g extended-keys on
set -ga terminal-features ",xterm-ghostty:extkeys"
# Cursor settings - enable blinking
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[2 q'
set -g cursor-style blinking-block
# Start numbering at 1
set -g base-index 1
setw -g pane-base-index 1
# Prefix key: Ctrl-Space
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
# Reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded!"
# Better splits
bind \\ split-window -h
bind - split-window -v
# Smart pane switching with Alt+arrow (no prefix needed)
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
# Alternative: Ctrl+h/j/k/l for vim-style navigation (no prefix needed)
# C-h and C-l wrap across windows and land on the edge-most pane in that direction
bind -n C-h if-shell -F "#{pane_at_left}" \
'run-shell "~/.tmux/wrap-nav.sh left"' \
'select-pane -L'
bind -n C-j select-pane -D
bind -n C-k select-pane -U
bind -n C-l if-shell -F "#{pane_at_right}" \
'run-shell "~/.tmux/wrap-nav.sh right"' \
'select-pane -R'
# Pane navigation in copy mode (stay in copy mode on the original pane)
bind -T copy-mode-vi C-h select-pane -L
bind -T copy-mode-vi C-j select-pane -D
bind -T copy-mode-vi C-k select-pane -U
bind -T copy-mode-vi C-l select-pane -R
# Vi mode
setw -g mode-keys vi
# Increase scrollback
set -g history-limit 10000
# Reduce escape delay
set -sg escape-time 0
# Dim inactive panes (foreground only)
# NOTE: Requires fresh tmux server start to take effect reliably
set -g window-style 'fg=colour247'
set -g window-active-style 'fg=colour255'
# Layout philosophy:
# Status bar = per-window info (tabs, session, machine identity, clock)
# Pane border = per-pane info (cwd — each pane can be in a different directory)
# Left side = interactive (tabs you click/switch between)
# Right side = reference (glance-at info that rarely changes)
# Uniform dark grey for everything except the active tab (white).
# Keeps the UI quiet — only what matters right now draws the eye.
# Pane borders - per-pane working directory
set -g pane-border-style 'bg=default,fg=colour240'
set -g pane-active-border-style 'bg=default,fg=colour240'
set -g pane-border-lines single
setw -g pane-border-status top
setw -g pane-border-format " #[fg=colour239]#{pane_current_path} "
# Status bar - single row, left-aligned tabs
set -g status on
set -g status-position top
set -g status-justify left
set -g status-style 'bg=default,fg=colour250'
set -g status-interval 60
set -g status-left-length 10
set -g status-right-length 100
# Left: tabs start immediately (no session prefix cluttering the interactive side)
set -g status-left " "
# Right: session │ clock (PST)
set -g status-right "#[fg=colour239] #S │ #(TZ=America/Los_Angeles date '+%%b %%d %%H:%%M') "
# Window tabs - active is white, inactive is mid-grey (readable but distinct)
# When @renaming is set (prefix+R), show "..." briefly while generating a name
set -g window-status-format " #W "
set -g window-status-style "bg=default,fg=colour245"
set -g window-status-current-format "#{?@renaming, ... , #W }"
set -g window-status-current-style "bg=default,fg=colour255"
set -g window-status-separator "#[bg=default,fg=colour245]│"
# Window naming
set -g automatic-rename off
set -g renumber-windows on
# Pass window name to terminal (Ghostty/terminal tab title)
# Uses BOX_PROVIDER env var if set (gcp, pi, neb, aws), otherwise just window name
set -g set-titles on
set -g set-titles-string "#{?BOX_PROVIDER,#{BOX_PROVIDER}: ,}#W"
# Force AI rename with prefix + R (bypasses debounce, renames ALL windows)
bind R set -g @renaming 1 \; run-shell "~/.tmux/ai-describe-pane.sh --force --all 2>/dev/null || true"
# Keep prefix+d for the standard detach behavior; avoid binding rename helpers to prefix keys.
bind d detach
# Auto-update window names (AI summarizes all panes in window)
# Note: '|| true' suppresses errors if llm CLI is not installed
set-hook -g after-select-pane "run-shell -b '~/.tmux/ai-describe-pane.sh 2>/dev/null || true'"
set-hook -g after-split-window "run-shell -b '~/.tmux/ai-describe-pane.sh 2>/dev/null || true'"
set-hook -g after-new-window "run-shell -b '~/.tmux/ai-describe-pane.sh 2>/dev/null || true'"
set-hook -g pane-exited "run-shell -b '~/.tmux/ai-describe-pane.sh 2>/dev/null || true'"
# Activity monitoring
setw -g monitor-activity on
set -g visual-activity off
set -g window-status-activity-style 'fg=colour246'