-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
183 lines (156 loc) · 6.29 KB
/
Copy pathtmux.conf
File metadata and controls
183 lines (156 loc) · 6.29 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
# =========================
# PREFIX
# =========================
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# =========================
# MOUSE
# =========================
set -g mouse on
# =========================
# STATUS BAR BASE
# =========================
set -g status on
set -g status-position bottom
set -g status-justify left
set -g status-style 'bg=#1d2021 fg=#ebdbb2'
# Disable right side completely
set -g status-right ""
set -g status-right-length 0
# Kill default window list
set -g window-status-format ""
set -g window-status-current-format ""
set -g window-status-separator ""
# =========================
# LEFT STATUS (Session + Window + Host)
# =========================
set -g status-left "\
#[fg=#1d2021,bg=#83a598,bold] #S \
#[fg=#83a598,bg=#b8bb26] \
#[fg=#1d2021,bg=#b8bb26,bold] #W \
#[fg=#b8bb26,bg=#fabd2f] \
#[fg=#1d2021,bg=#fabd2f,bold] #H \
#[fg=#fabd2f,bg=#3c3836]"
set -g status-left-length 200
# =========================
# INDEXING
# =========================
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
# =========================
# TERMINAL / PERFORMANCE
# =========================
set -g history-limit 50000
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",*256col*:Tc"
set -sg escape-time 0
# =========================
# PANES STYLE
# =========================
set -g pane-border-style 'fg=#3c3836'
set -g pane-active-border-style 'fg=#83a598'
set -g message-style 'fg=#fabd2f bg=default bold'
# =========================
# SPLIT PANES
# =========================
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# =========================
# RELOAD CONFIG
# =========================
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# =========================
# NAVIGATION (VIM STYLE)
# =========================
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# =========================
# COPY MODE (VIM STYLE)
# =========================
setw -g mode-keys vi
# Enter copy mode with prefix+v (prefix+[ still works)
bind v copy-mode
# v = visual select, V = line select, C-v = block select, y = yank
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi V send -X select-line
bind -T copy-mode-vi C-v send -X rectangle-toggle
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "pbcopy"
bind -T copy-mode-vi Y send -X copy-pipe-and-cancel "pbcopy"
bind -T copy-mode-vi Escape send -X cancel
# Mouse drag selects and copies to system clipboard
bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "pbcopy"
# Click without dragging clears selection instead of exiting copy mode
unbind -T copy-mode-vi MouseDown1Pane
# Paste from tmux buffer
bind p paste-buffer
bind P choose-buffer
bind -T copy-mode-vi / send -X search-forward
bind -T copy-mode-vi ? send -X search-backward
set -g @ccol 0
# Horizontal motions record the new desired column.
bind -T copy-mode-vi h { send -X cursor-left ; run -C "set -pt '#{pane_id}' @ccol '#{copy_cursor_x}'" }
bind -T copy-mode-vi l { send -X cursor-right ; run -C "set -pt '#{pane_id}' @ccol '#{copy_cursor_x}'" }
bind -T copy-mode-vi Left { send -X cursor-left ; run -C "set -pt '#{pane_id}' @ccol '#{copy_cursor_x}'" }
bind -T copy-mode-vi Right { send -X cursor-right ; run -C "set -pt '#{pane_id}' @ccol '#{copy_cursor_x}'" }
bind -T copy-mode-vi w { send -X next-word ; run -C "set -pt '#{pane_id}' @ccol '#{copy_cursor_x}'" }
bind -T copy-mode-vi b { send -X previous-word ; run -C "set -pt '#{pane_id}' @ccol '#{copy_cursor_x}'" }
bind -T copy-mode-vi e { send -X next-word-end ; run -C "set -pt '#{pane_id}' @ccol '#{copy_cursor_x}'" }
bind -T copy-mode-vi W { send -X next-space ; run -C "set -pt '#{pane_id}' @ccol '#{copy_cursor_x}'" }
bind -T copy-mode-vi B { send -X previous-space ; run -C "set -pt '#{pane_id}' @ccol '#{copy_cursor_x}'" }
bind -T copy-mode-vi E { send -X next-space-end ; run -C "set -pt '#{pane_id}' @ccol '#{copy_cursor_x}'" }
bind -T copy-mode-vi ^ { send -X back-to-indentation ; run -C "set -pt '#{pane_id}' @ccol '#{copy_cursor_x}'" }
bind -T copy-mode-vi 0 { send -X start-of-line ; run -C "set -pt '#{pane_id}' @ccol 0" }
# $ sticks to end-of-line the way vim does
bind -T copy-mode-vi '$' { send -X end-of-line ; run -C "set -pt '#{pane_id}' @ccol 99999" }
# Vertical motions restore the column, clamped to the new line's length.
bind -T copy-mode-vi j {
send -X cursor-down
send -X start-of-line
run -C "set -pt '#{pane_id}' @tgt '#{?#{e|>:#{@ccol},#{e|-:#{n:copy_cursor_line},1}},#{e|-:#{n:copy_cursor_line},1},#{@ccol}}'"
run -C "#{?#{e|>:#{@tgt},0},send -N #{@tgt} -X cursor-right,set -p @noop 0}"
}
bind -T copy-mode-vi k {
send -X cursor-up
send -X start-of-line
run -C "set -pt '#{pane_id}' @tgt '#{?#{e|>:#{@ccol},#{e|-:#{n:copy_cursor_line},1}},#{e|-:#{n:copy_cursor_line},1},#{@ccol}}'"
run -C "#{?#{e|>:#{@tgt},0},send -N #{@tgt} -X cursor-right,set -p @noop 0}"
}
bind -T copy-mode-vi Down {
send -X cursor-down
send -X start-of-line
run -C "set -pt '#{pane_id}' @tgt '#{?#{e|>:#{@ccol},#{e|-:#{n:copy_cursor_line},1}},#{e|-:#{n:copy_cursor_line},1},#{@ccol}}'"
run -C "#{?#{e|>:#{@tgt},0},send -N #{@tgt} -X cursor-right,set -p @noop 0}"
}
bind -T copy-mode-vi Up {
send -X cursor-up
send -X start-of-line
run -C "set -pt '#{pane_id}' @tgt '#{?#{e|>:#{@ccol},#{e|-:#{n:copy_cursor_line},1}},#{e|-:#{n:copy_cursor_line},1},#{@ccol}}'"
run -C "#{?#{e|>:#{@tgt},0},send -N #{@tgt} -X cursor-right,set -p @noop 0}"
}
# Selection colors
set -g mode-style 'bg=#504945 fg=#ebdbb2'
# =========================
# WORKSPACE LAYOUT
# =========================
bind W split-window -h -c "#{pane_current_path}" \; \
send-keys 'claude' C-m \; \
split-window -v -c "#{pane_current_path}" \; \
send-keys 'clear' C-m \; \
select-pane -L \; \
resize-pane -R 30
# =========================
# PLUGINS (TPM)
# =========================
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Persist & auto-restore sessions across reboots
set -g @resurrect-capture-pane-contents 'on'
set -g @continuum-restore 'on'
set -g @continuum-save-interval '15'
# Initialize TPM (keep this line at the very bottom)
run '~/.tmux/plugins/tpm/tpm'