-
Notifications
You must be signed in to change notification settings - Fork 776
Expand file tree
/
Copy pathtmux.conf
More file actions
52 lines (40 loc) · 1.81 KB
/
tmux.conf
File metadata and controls
52 lines (40 loc) · 1.81 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
# Terminal with true color support
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm*:Tc:smcup@:rmcup@"
set -ag terminal-overrides ",*256col*:Tc"
# Performance
set -sg escape-time 0
set -g history-limit 50000
# Vi key bindings
setw -g mode-keys vi
set -g status-keys vi
# Vi-style pane navigation
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Vi-style copy mode
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
# Reload config
bind r source-file ~/.tmux.conf \; display "Config reloaded"
# Clear screen and scrollback (triggered by Ghostty Cmd+K)
bind K send-keys -R \; clear-history
# Hide time from status bar
set -g status-right ""
# Mouse support (scroll + drag-to-copy)
set -g mouse on
# Auto-enter copy-mode when scrolling up (critical for WSL compatibility)
# This handles: 1) apps with mouse support, 2) already in copy-mode, 3) normal pane
bind-key -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
# Scroll bindings in copy-mode (both vi and emacs modes)
bind-key -T copy-mode-vi WheelUpPane send-keys -X scroll-up
bind-key -T copy-mode-vi WheelDownPane send-keys -X scroll-down
bind-key -T copy-mode WheelUpPane send-keys -X scroll-up
bind-key -T copy-mode WheelDownPane send-keys -X scroll-down
# Clipboard integration (drag-to-copy)
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X stop-selection
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X stop-selection
bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word
bind-key -T copy-mode DoubleClick1Pane select-pane \; send-keys -X select-word
bind-key -n DoubleClick1Pane select-pane -t = \; copy-mode \; send-keys -X select-word