Switch to whitelist-based .gitignore to only track essential configs: nvim, yazi, kitty, zsh, ideavim, karabiner, tmux, scripts, starship. Remove history, compiled files, and plugin dirs from tracking. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
213 lines
6.4 KiB
Bash
213 lines
6.4 KiB
Bash
# ============================================
|
|
# TMUX CONFIGURATION
|
|
# ============================================
|
|
|
|
# ============================================
|
|
# TERMINAL & ENVIRONMENT
|
|
# ============================================
|
|
|
|
# Terminal settings
|
|
set -g allow-passthrough on
|
|
set -ga update-environment TERM
|
|
set -ga update-environment TERM_PROGRAM
|
|
set -g default-terminal "tmux-256color"
|
|
set-option -ga terminal-overrides ",xterm-kitty:Tc,*:Tc,*:RGB"
|
|
set -as terminal-features ",xterm-256color:RGB,tmux-256color:RGB"
|
|
|
|
# Shell configuration
|
|
set -g default-command /bin/zsh
|
|
|
|
# Environment variables for proper shell integration
|
|
# KITTY_WINDOW_ID and KITTY_PID intentionally NOT passed through
|
|
# so Yazi inside tmux doesn't auto-detect Kitty and send kitty graphics protocol
|
|
set -ga update-environment XDG_CONFIG_HOME
|
|
set -ga update-environment ZDOTDIR
|
|
|
|
# ============================================
|
|
# GENERAL SETTINGS
|
|
# ============================================
|
|
|
|
# Start windows and panes at 1, not 0
|
|
set -g base-index 1
|
|
setw -g pane-base-index 1
|
|
|
|
# Renumber windows when one is closed
|
|
set -g renumber-windows on
|
|
|
|
# Increase scrollback buffer size
|
|
set -g history-limit 10000
|
|
|
|
# Let tmux auto-name unnamed windows, but keep manual names sticky.
|
|
# `allow-rename` lets shells/apps overwrite names via terminal title escapes.
|
|
set-option -g allow-rename off
|
|
set-option -g automatic-rename on
|
|
|
|
# Reduce escape time for neovim
|
|
set -sg escape-time 0
|
|
|
|
# Enable focus events
|
|
set -g focus-events on
|
|
|
|
# Show pane numbers longer
|
|
set -g display-panes-time 2000
|
|
|
|
# Show messages longer
|
|
set -g display-time 2000
|
|
|
|
# Resize to largest attached client
|
|
set -g window-size largest
|
|
|
|
# ============================================
|
|
# VI-LIKE KEYBINDINGS
|
|
# ============================================
|
|
|
|
# Vi mode
|
|
setw -g mode-keys vi
|
|
set -g status-keys vi
|
|
|
|
# Smart pane switching with vim awareness handled by vim-tmux-navigator plugin
|
|
|
|
# Vi-like pane resizing
|
|
bind -r H resize-pane -L 5
|
|
bind -r J resize-pane -D 5
|
|
bind -r K resize-pane -U 5
|
|
bind -r L resize-pane -R 5
|
|
|
|
# Vi-like copy mode
|
|
bind-key -T copy-mode-vi 'v' send -X begin-selection
|
|
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
|
|
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle
|
|
|
|
# Enter copy mode with Escape
|
|
bind Escape copy-mode
|
|
|
|
# ============================================
|
|
# PANE MANAGEMENT
|
|
# ============================================
|
|
|
|
# Split panes with v and s (vi-like), defaults % and " still work
|
|
bind v split-window -h -c "#{pane_current_path}"
|
|
bind s split-window -v -c "#{pane_current_path}"
|
|
bind % split-window -h -c "#{pane_current_path}"
|
|
bind '"' split-window -v -c "#{pane_current_path}"
|
|
|
|
# New window in current path
|
|
bind c new-window -c "#{pane_current_path}"
|
|
|
|
# Quick pane cycling
|
|
bind -r C-h select-window -t :-
|
|
|
|
# Kill pane without confirmation
|
|
bind x kill-pane
|
|
|
|
# Kill window without confirmation
|
|
bind X kill-window
|
|
|
|
# Toggle zoom
|
|
bind z resize-pane -Z
|
|
|
|
# Quick session switching
|
|
bind S choose-tree -sZ -O name
|
|
|
|
# Create new session
|
|
bind N command-prompt -p "New session name:" "new-session -d -s '%%'"
|
|
|
|
# ============================================
|
|
# MOUSE SUPPORT
|
|
# ============================================
|
|
|
|
set -g mouse on
|
|
|
|
# Don't jump to bottom when mouse selecting
|
|
unbind -T copy-mode-vi MouseDragEnd1Pane
|
|
|
|
# Mouse click behavior - simple pane selection without copy-mode
|
|
bind-key -T copy-mode-vi MouseDown1Pane select-pane
|
|
bind-key -T copy-mode MouseDown1Pane select-pane
|
|
bind-key -n MouseDown1Pane select-pane -t =
|
|
|
|
# ============================================
|
|
# PLUGINS
|
|
# ============================================
|
|
|
|
set -g @plugin 'tmux-plugins/tpm'
|
|
set -g @plugin 'tmux-plugins/tmux-sensible'
|
|
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
|
set -g @plugin 'tmux-plugins/tmux-continuum'
|
|
set -g @plugin 'tmux-plugins/tmux-yank'
|
|
set -g @plugin 'tmux-plugins/tmux-copycat'
|
|
set -g @plugin 'sainnhe/tmux-fzf'
|
|
set -g @plugin 'laktak/extrakto'
|
|
set -g @plugin 'wfxr/tmux-fzf-url'
|
|
set -g @plugin 'christoomey/vim-tmux-navigator'
|
|
set -g @plugin 'fcsonline/tmux-thumbs'
|
|
set -g @plugin 'omerxx/tmux-sessionx'
|
|
set -g @plugin 'joshmedeski/tmux-nerd-font-window-name'
|
|
|
|
# Persist and restore tmux sessions across restarts
|
|
set -g @resurrect-capture-pane-contents 'on'
|
|
set -g @continuum-restore 'on'
|
|
set -g @continuum-save-interval '15'
|
|
|
|
# sessionx
|
|
set -g @sessionx-bind 'o'
|
|
|
|
# tmux-thumbs
|
|
set -g @thumbs-key 'f'
|
|
set -g @thumbs-command 'echo -n {} | pbcopy && tmux display-message "Copied!"'
|
|
|
|
# ============================================
|
|
# STYLING
|
|
# ============================================
|
|
|
|
set -g status-position top
|
|
set -g pane-border-status top
|
|
set -g pane-border-format "#[fg=#cdd6f4] #P #[fg=#6c7086]| #[fg=#89b4fa]#{pane_current_command} #[fg=#6c7086]| #[fg=#a6adc8]#{pane_current_path}"
|
|
set -g clock-mode-style 24
|
|
|
|
# Activity monitoring
|
|
set -g monitor-activity on
|
|
set -g visual-activity off
|
|
set -g activity-action other
|
|
|
|
# Bell settings
|
|
set -g monitor-bell on
|
|
set -g visual-bell off
|
|
set -g bell-action any
|
|
|
|
# ============================================
|
|
# TRANSPARENCY
|
|
# ============================================
|
|
|
|
set -g window-style "bg=default"
|
|
set -g window-active-style "bg=default"
|
|
|
|
# ============================================
|
|
# THEME
|
|
# ============================================
|
|
|
|
source-file ~/.config/tmux/themes/tmuxline.tmux
|
|
|
|
# ============================================
|
|
# KEYBINDINGS
|
|
# ============================================
|
|
|
|
# Clear stale bindings removed from older config revisions
|
|
unbind /
|
|
|
|
# Three-way toggle: top → bottom → hidden → top
|
|
bind b if -F "#{==:#{status},off}" \
|
|
"set -g status on ; set -g status-position top ; set -g pane-border-status top" \
|
|
"if -F '#{==:#{status-position},top}' \
|
|
'set -g status-position bottom' \
|
|
'set -g status off ; set -g pane-border-status off'"
|
|
|
|
# Reload config
|
|
bind r source-file ~/.config/tmux/tmux.conf \; display-message " Config reloaded!"
|
|
|
|
# SessionX in window mode on demand
|
|
bind O run-shell 'old_mode="$(tmux show-option -gqv @sessionx-window-mode)"; tmux set-option -g @sessionx-window-mode on; ~/.config/tmux/plugins/tmux-sessionx/sessionx.tmux >/dev/null 2>&1; ~/.config/tmux/plugins/tmux-sessionx/scripts/sessionx.sh; if [ -n "$old_mode" ]; then tmux set-option -g @sessionx-window-mode "$old_mode"; else tmux set-option -gu @sessionx-window-mode; fi; ~/.config/tmux/plugins/tmux-sessionx/sessionx.tmux >/dev/null 2>&1'
|
|
|
|
# Initialize TMUX plugin manager (keep this line at the very bottom)
|
|
run '~/.config/tmux/plugins/tpm/tpm'
|