-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.bak
More file actions
212 lines (163 loc) · 14.7 KB
/
Copy pathtmux.bak
File metadata and controls
212 lines (163 loc) · 14.7 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# ████████╗███╗ ███╗██╗ ██╗██╗ ██╗
# ╚══██╔══╝████╗ ████║██║ ██║╚██╗██╔╝
# ██║ ██╔████╔██║██║ ██║ ╚███╔╝ ~/.config/tmux/tmux.conf
# ██║ ██║╚██╔╝██║██║ ██║ ██╔██╗
# ██║ ██║ ╚═╝ ██║╚██████╔╝██╔╝ ██╗
# ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
# ╭──────────────────────────────────────────────────────────────────────────────╮
# │ INDEXING / HISTORY / SESSION MANAGEMENT │
# ╰──────────────────────────────────────────────────────────────────────────────╯
set -g base-index 1 # Start window indexing at 1 (not 0).
setw -g pane-base-index 1
set -g detach-on-destroy off # Keep server alive when last session closes.
set -g escape-time 0 # Make Escape instantaneous for vi-like flows.
set -g history-limit 1000000 # Large scrollback history per pane.
set -g mouse on # Mouse: select panes, resize, scroll.
set -g renumber-windows on # Compact/renumber windows when some close.
set -g set-clipboard on # Integrate with system clipboard when possible.
set -g status-interval 3 # Status line refresh cadence (seconds).
set -g aggressive-resize on # Allow windows to resize to the active client.
# ╭──────────────────────────────────────────────────────────────────────────────╮
# │ TERMINAL / SHELL SETUP │
# ╰──────────────────────────────────────────────────────────────────────────────╯
set -g default-terminal "tmux-256color" # IMPORTANT
set -ga terminal-overrides ",xterm-256color:Tc" # IMPORTANT
set-option -g default-shell /opt/homebrew/bin/fish
# Propagate terminal focus in/out events to applications that support them.
set-option -g focus-events on
# ╭──────────────────────────────────────────────────────────────────────────────╮
# │ UNBINDS / BINDS │
# ╰────────────────────────────────────────────────────────────────────────────╯
unbind '"'
unbind '%'
unbind '-'
unbind '|'
bind - split-window -v -c '#{pane_current_path}' # Horizontal split
bind | split-window -h -c '#{pane_current_path}' # Vertical split
unbind c
bind-key c kill-pane
unbind t
bind t new-window -c '#{pane_current_path}'
unbind ',' # Rename session (prompt)
bind-key , command-prompt -p "Rename session to:" "rename-session '%%'" # Confirm new name
unbind r # Reload config quickly
bind r source-file ~/.config/tmux/tmux.conf
unbind Z # Toggle status bar visibility
bind Z set-option -g status
# Quick-capture current pane to a scratch buffer in Neovim.
unbind e
bind-key e send-keys "tmux capture-pane -p -S - | nvim -c 'set buftype=nofile' +" Enter
### NEW BIND LAYOUT
unbind h
bind h previous-window
unbind l
bind l next-window
# ╭──────────────────────────────────────────────────────────────────────────────╮
# │ ALACRITTY │
# ╰──────────────────────────────────────────────────────────────────────────────╯
# bind g new-window -n '' lazygit # Open Lazygit
# bind l new-window -n '' lf # Open lf (file manager)
# ╭──────────────────────────────────────────────────────────────────────────────╮
# │ Vim-style pane navigation. │
# ╰──────────────────────────────────────────────────────────────────────────────╯
# bind -r h select-pane -L # BINDING ON TOP
bind -r j select-pane -D
bind -r k select-pane -U
# bind -r l select-pane -R # BINDING ON TOP
unbind s
unbind w
bind s display-popup -E -w 80% -h 75% "tmux choose-tree -Zs -F '#{?pane_format,#[default]#{window_index}#{b:pane_current_path},#[fg=#87a1ee] #{session_windows} tabs}'"
# bind s choose-tree -s \-F '#{?pane_format,#[default]#{window_index}#{b:pane_current_path},#[fg=#87a1ee] #{session_windows} tabs}'
bind w choose-tree -Zw -F '#[fg=#87a1ee]#{?window_active,#[fg=#87a1ee],#[fg=#464347]}#{b:pane_current_path}#{?window_zoomed_flag, 🔍,}#{?window_bell_flag, 🔔,}'
# ╭──────────────────────────────────────────────────────────────────────────────╮
# │ COPY-MODE │
# ╰──────────────────────────────────────────────────────────────────────────────╯
# Use vi keybindings inside copy-mode (modern default for devs)
setw -g mode-keys vi
# ⚡ Enhanced Copy Mode Entry with Visual Feedback ⚡
bind-key [ copy-mode \; display-message "VI COPY MODE"
# ── VI Mode Keybindings with Visual Feedback ──────────────────────────────────
# Quick exit with notification
bind -T copy-mode-vi q send-keys -X cancel \; display-message "❌ VI Mode Exited"
# Visual selection modes with status feedback
bind -T copy-mode-vi v send-keys -X begin-selection \; display-message "📝 Visual Selection Started"
bind -T copy-mode-vi V send-keys -X select-line \; display-message "📏 Line Selection Mode"
bind -T copy-mode-vi C-v send-keys -X rectangle-toggle \; display-message "▭ Block Selection Mode"
# Enhanced copy operations with notifications
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy" \; display-message "📋 Copied to clipboard!"
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy" \; display-message "✅ Selection copied!"
# Smart mouse integration
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy" \; display-message "🖱️ Mouse selection copied!"
# Additional vim-like movements
bind -T copy-mode-vi 'C-u' send-keys -X halfpage-up
bind -T copy-mode-vi 'C-d' send-keys -X halfpage-down
bind -T copy-mode-vi '0' send-keys -X start-of-line
bind -T copy-mode-vi '$' send-keys -X end-of-line
# Search in copy mode (like vim)
bind -T copy-mode-vi '/' send-keys -X search-forward
bind -T copy-mode-vi '?' send-keys -X search-backward
bind -T copy-mode-vi 'n' send-keys -X search-again
bind -T copy-mode-vi 'N' send-keys -X search-reverse
# ╭──────────────────────────────────────────────────────────────────────────────╮
# │ STATUS BAR / UI (THEMING) │
# ╰────────────────────────────────────────────────────────────────────────────╯
# ── Terminal / Truecolor ────────────────────────────────────────────────────────
# Advertise 24-bit color and enable truecolor overrides for common TERM entries.
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",alacritty:Tc,xterm-256color:Tc,screen-256color:Tc"
# ── Status Bar: Frame / Layout ─────────────────────────────────────────────────
# Transparent status line, pinned to top, refreshed every 60s, left-justified.
set-option -g status-style bg=default,fg=default
set -g status-position top # top | bottom
set -g status-interval 60
set -g status-justify left # left | centre | right
# ── Palette Reference (for theming guidance) ───────────────────────────────────
# base=#1a1b26 accent=#7aa2f7 dim=#414868 text=#c0caf5 sub=#565f89
# neon=#7aa2f7 warn=#f7768e highlight=#bb9af7 error=#f7768e success=#9ece6a
# ── Pane / Border Styles ───────────────────────────────────────────────────────
# Inactive vs. active pane borders and pane index overlay colors.
set -g pane-border-style "fg=#87a1ee"
set -g pane-active-border-style "fg=#7aa2f7,bold"
set -g display-panes-colour "#414868" # cmd+w no-active-pane
set -g display-panes-active-colour "#87a1ee" # cmd+w active-pane
set -g pane-border-status off # (line placement): top | bottom | off
set -g pane-active-border-style 'fg=#87a1ee' # (border line) color
set -g pane-border-format '#[bold]#{}#[default]' # information displayed (none)
### set -g pane-border-format '#{?pane_in_mode,#[bold]#[bg=#bb9af7,fg=#1a1b26] ⛁ COPY (vi) #[default], }'
# ── Messages / Modes / Alerts ─────────────────────────────────────────────────
# Message area, command-prompt, copy/scroll mode look, clock, bell, and activity.
set-option -g message-style bg=#000000,fg=#7aa2f7,bold
set-option -g message-command-style bg=#000000,fg=#7aa2f7,bold
setw -g mode-style "bg=#565f89,fg=#c0caf5,italics"
set-window-option -g clock-mode-colour "#bb9af7"
set-window-option -g window-status-bell-style bg=#f7768e,fg=#1a1b26,bold
set-window-option -g window-status-activity-style bg=#414868,fg=#9ece6a
# ── Window Tabs / Titles ───────────────────────────────────────────────────────
# Separator and titles for current vs. inactive windows (using pane path labels).
setw -g window-status-separator "#[fg=#to_do] " # Suggested glyphs: | ┊
# setw -g window-status-current-format "#[fg=#87a1ee](#{b:pane_current_path})"
setw -g window-status-current-format "#[fg=#87a1ee, bold] (#{b:pane_current_path})" # Active window
setw -g window-status-format "#[fg=#737373](#{b:pane_current_path})" # Inactive window
### setw -g window-status-current-format "#[fg=#87a1ee](#{b:pane_current_path})"
### setw -g window-status-format "#[fg=#446068](#{window_index}. #{b:pane_current_path})"
# ── Status: Left Segment ───────────────────────────────────────────────────────
# Session badge with conditional indicators: prefix, zoom, and pane sync.
set -g status-left-length 120
set-option -g status-left "#[fg=#87a1ee]#{?client_prefix,#[fg=#0bce98#,bold],} #S ┊#{?client_prefix, [prefix mode],}#[fg=#ffffff]#{?window_zoomed_flag, zoom,} #{?pane_synchronized, ,}"
# ── Status: Right Segment ──────────────────────────────────────────────────────
# System metrics script + time/date (wide right segment for breathing room).
# run-shell -b "$HOME/.config/tmux/scripts/mem-cpu.sh"
set -g status-right-length 120
set -g status-right '#[fg=#87a1ee]#($HOME/.config/tmux/scripts/mem-cpu.sh) #[fg=#87a1ee]┊ #[fg=#87a1ee]%I:%M%p %B %d, %Y'
### set -g status-right '#[fg=#7aa2f7]#($HOME/.config/tmux/scripts/mem-cpu.sh) · #[fg=#bb9af7]%H:%M:%S #[fg=#7aa2f7]%d.%m.%Y'
### set -g status-right '#[fg=#7aa2f7]#(cat "$HOME/.cache/tmux/sysline.txt" 2>/dev/null || echo "CPU --% · RAM --/--") · #[fg=#7aa2f7](%I:%M:%S %p | %B %d, %Y)'
### set-option -g status-right "#(~/.config/tmux/scripts/mem-cpu.sh)"
# ╭──────────────────────────────────────────────────────────────────────────────╮
# │ PLUGINS │
# ╰────────────────────────────────────────────────────────────────────────────╯
# TPM + system metrics plugin (expects tmux-mem-cpu-load binary/script available).
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect' # Plugin for restoring tmux sessions
set -g @plugin 'tmux-plugins/tmux-continuum' # Continuum plugin for session management
# set -g @plugin 'thewtex/tmux-mem-cpu-load'
run '~/.config/tmux/plugins/tpm/tpm'