forked from holman/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.tmux.conf
More file actions
171 lines (137 loc) · 6.78 KB
/
.tmux.conf
File metadata and controls
171 lines (137 loc) · 6.78 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
# Terminal settings
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-ghostty:Tc"
set -ga terminal-overrides ",xterm-256color*:Tc"
# Ghostty passthrough (for images/graphics)
set -g allow-passthrough on
# Undercurl support (for Neovim LSP diagnostics)
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'
# Extended keys (Ctrl+Shift combos)
set -g extended-keys on
set -as terminal-features ',xterm-ghostty:extkeys'
# Prefix key: Ctrl+a (easier than Ctrl+b)
unbind C-b
set -gw prefix C-a
bind a send-prefix
# Open new panes/windows in same directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Faster escape time (for vim)
set-option -sg escape-time 10
set-option -g focus-events on
# Window navigation (shift+arrow)
bind -n S-down new-window
bind -n S-left prev
bind -n S-right next
bind -n C-left swap-window -d -t -1
bind -n C-right swap-window -d -t +1
# Vim-like pane navigation
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# History (large for Claude output)
set -g history-limit 100000
# Mouse support (scroll, select panes/windows, resize)
set -g mouse on
# Renumber windows when one closes (no gaps)
set -g renumber-windows on
# Quick config reload
bind r source-file ~/.tmux.conf \; display "Config reloaded!"
# Longer display time for messages
set -g display-time 2000
set -g display-panes-time 2000
# Sync tmux window name to terminal (Ghostty tab) title
set -g set-titles on
# Only show command if not a shell/pager, with emoji indicators for AI/editors
set -g set-titles-string "#S:#W#{?#{m/r:^(fish|bash|zsh|sh|less|more|cat)$,#{pane_current_command}},,#{?#{m/r:^(claude|codex|cursor-cli),#{pane_current_command}}, 🤖,#{?#{m/r:^(nvim|vim|code|cursor)$,#{pane_current_command}}, ⌨️,:#{pane_current_command}}}}"
# Vi-style copy mode
# prefix+[ to enter, v to select, y to yank to clipboard
setw -g mode-keys vi
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "pbcopy"
# Rectangle/block selection (prefix+[ then C-v)
bind -T copy-mode-vi C-v send -X rectangle-toggle
# Copy line (Y)
bind -T copy-mode-vi Y send -X select-line \; send -X copy-pipe-and-cancel "pbcopy"
# Copy to end of line (D like vim)
bind -T copy-mode-vi D send -X copy-end-of-line-and-cancel \; run "tmux save-buffer - | pbcopy"
# Incremental search (/ forward, ? backward)
bind -T copy-mode-vi / command-prompt -i -p "(search down)" "send -X search-forward-incremental \"%%%\""
bind -T copy-mode-vi ? command-prompt -i -p "(search up)" "send -X search-backward-incremental \"%%%\""
# Quick scroll (half page with C-u/C-d like vim)
bind -T copy-mode-vi C-u send -X halfpage-up
bind -T copy-mode-vi C-d send -X halfpage-down
# Quick search for code blocks (prefix + ` to find ```)
bind ` copy-mode \; send-keys -X search-backward '```'
# Auto-rename windows to current directory
setw -g automatic-rename-format "#{b:pane_current_path}"
# ============================================================================
# Claude / Development Workflows
# ============================================================================
# Claude popup (prefix + C) - quick queries without disrupting layout
bind C display-popup -E -w 85% -h 85% -d "#{pane_current_path}" "claude"
# Dev layout (prefix + g c) - 2x2 grid, YOLO mode
# +-------------+-------------+
# | Server | Shell |
# +-------------+-------------+
# | Claude | Nvim |
# +-------------+-------------+
bind g switch-client -T go-table
bind -T go-table c run-shell "$HOME/.dotfiles/bin/tmux-layout --yolo"
bind -T go-table C run-shell "$HOME/.dotfiles/bin/tmux-layout --yolo --new-window"
# fzf popup for all file:line references in scrollback (prefix + f)
bind f run-shell "$HOME/.dotfiles/bin/tmux-fzf-files"
# ============================================================================
# Plugins
# ============================================================================
# TPM plugin path (required for install_plugins script)
set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.tmux/plugins/'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Continuum settings (auto-save/restore sessions)
set -g @continuum-restore 'on'
set -g @continuum-boot 'off'
set -g @continuum-boot-options 'ghostty,fullscreen'
# ============================================================================
# Theme (Poimandres-inspired)
# ============================================================================
set -g status "on"
set -g status-justify "left"
set -g status-style "none,bg=default"
set -g status-left-style "none"
set -g status-left-length "100"
set -g status-right-style "none"
set -g status-right-length "100"
# Pane borders
set -g pane-border-style "fg=#33394a,bg=default"
set -g pane-active-border-style "fg=#404350,bg=default"
set -g pane-border-status bottom
set -g pane-border-format ""
# Messages
set -g message-style "fg=brightwhite,bg=default"
set -g message-command-style "fg=brightwhite,bg=default"
# Window status
setw -g window-status-activity-style "none"
setw -g window-status-separator " "
setw -g window-status-style "none,fg=brightwhite,bg=default"
# Status bar
set -g status-left "#[fg=#5de4c7,bg=default,bold]#S #[fg=brightwhite,bg=default,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#868cad,bg=default]%I:%M%p #[fg=#868cad,bg=default] %m/%d/%Y "
# Use #W for window name, only show command if not a shell/pager
# 🤖 for AI agents, ⌨️ for editors
set -g window-status-format '#[fg=#5fb3a1,bg=default] #I#[fg=#868cad,bg=default] #W#{?#{m/r:^(fish|bash|zsh|sh|less|more|cat)$,#{pane_current_command}},,#{?#{m/r:^(claude|codex|cursor-cli),#{pane_current_command}}, 🤖,#{?#{m/r:^(nvim|vim|code|cursor)$,#{pane_current_command}}, ⌨️,:#{pane_current_command}}}} '
set -g window-status-current-format '#[fg=#5de4c7,bg=default] #I#[fg=#ffffff,bg=default] #W#{?#{m/r:^(fish|bash|zsh|sh|less|more|cat)$,#{pane_current_command}},,#{?#{m/r:^(claude|codex|cursor-cli),#{pane_current_command}}, 🤖,#{?#{m/r:^(nvim|vim|code|cursor)$,#{pane_current_command}}, ⌨️,:#{pane_current_command}}}} '
set -g status-interval 5
# ============================================================================
# Bell passthrough (for remote Claude notifications -> Ghostty)
# ============================================================================
set -g visual-bell off
set -g bell-action any
# ============================================================================
# Initialize TPM (keep at bottom)
# ============================================================================
run -b '~/.tmux/plugins/tpm/tpm'