-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_tmux.conf
More file actions
111 lines (96 loc) · 6.6 KB
/
Copy pathdot_tmux.conf
File metadata and controls
111 lines (96 loc) · 6.6 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
# ~/.tmux.conf
# Tuned for remote (SSH) work with Claude Code inside tmux.
# Official guidance: https://code.claude.com/docs/en/terminal-config#configure-tmux
# ─────────────────────────────────────────────────────────────
# Required by Claude Code (per official docs)
# ─────────────────────────────────────────────────────────────
# 1) Let desktop notifications (OSC 9) and the progress bar reach the outer
# terminal instead of being swallowed by tmux. Also needed by image protocols.
set -g allow-passthrough on
# 2) Distinguishing Shift+Enter (newline) from plain Enter needs the extended
# key protocol. With tmux defaults, Shift+Enter is treated as "submit".
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'
# If Shift+Enter still does not work, uncomment the line below: it makes tmux
# forward extended keys unconditionally, even to apps that never request the
# kitty keyboard protocol.
# set -s extended-keys always
# ─────────────────────────────────────────────────────────────
# Terminal / color (Claude Code themes use 24-bit color)
# ─────────────────────────────────────────────────────────────
set -g default-terminal "tmux-256color"
set -as terminal-features ',*:RGB'
set -as terminal-features ',*:usstyle' # undercurl and colored underlines
set -g focus-events on # let editors detect focus changes
set -g set-titles on # forward window title to outer terminal
set -g set-titles-string '#S:#W - #{pane_current_path}'
# Let the bell through (used when preferredNotifChannel is "terminal_bell")
set -g bell-action any
set -g visual-bell off
set -g visual-activity off
set -g monitor-bell on
# ─────────────────────────────────────────────────────────────
# Remote session ergonomics
# ─────────────────────────────────────────────────────────────
set -sg escape-time 10 # drop the ESC delay in vim
set -g history-limit 50000 # room for long Claude sessions
set -g mouse on # scrolling/selection in fullscreen TUI
set -g aggressive-resize on # size to the smallest attached client
set -g detach-on-destroy off # switch to another session instead of detaching
set -g display-time 2000
set -g status-interval 5
set -g renumber-windows on
set -g base-index 1
setw -g pane-base-index 1
set-option -g allow-rename off
setw -g mode-keys vi
# ─────────────────────────────────────────────────────────────
# Clipboard: use OSC 52 so copies land in the *local* clipboard over SSH.
# wl-copy/xclip would target the remote machine, which is not what we want.
# ─────────────────────────────────────────────────────────────
set -s set-clipboard on
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi V send-keys -X rectangle-toggle
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
bind-key -T copy-mode-vi Enter send-keys -X copy-selection-and-cancel
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-selection-and-cancel
# Enter copy-mode naturally on wheel scroll
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
# ─────────────────────────────────────────────────────────────
# Key bindings
# ─────────────────────────────────────────────────────────────
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
bind h select-pane -L
bind l select-pane -R
bind j select-pane -D
bind k select-pane -U
bind -n M-H resize-pane -L 2
bind -n M-J resize-pane -D 2
bind -n M-K resize-pane -U 2
bind -n M-L resize-pane -R 2
bind r source-file ~/.tmux.conf \; display-message "tmux.conf reloaded"
# ─────────────────────────────────────────────────────────────
# Appearance
# ─────────────────────────────────────────────────────────────
set -g pane-border-style 'fg=color233 bg=color234'
set -g pane-active-border-style 'bg=color234 fg=color46'
set -g status-position bottom
set -g status-style 'bg=color233 fg=color15 dim'
# ─────────────────────────────────────────────────────────────
# Plugins (tpm) — keep sessions across reboots
# prefix + I : install plugins / prefix + U : update plugins
# prefix + Ctrl-s : save session / prefix + Ctrl-r : restore session
# ─────────────────────────────────────────────────────────────
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @resurrect-capture-pane-contents 'on' # restore pane screen contents too
set -g @resurrect-strategy-nvim 'session'
set -g @continuum-restore 'on' # auto-restore when the tmux server starts
set -g @continuum-save-interval '15' # auto-save every 15 minutes
# tpm init must stay at the very bottom of this file
run '~/.tmux/plugins/tpm/tpm'