Files
dotfiles/.config/tmux/tmux.conf
T
Anthony Oteri 789a48ecc4 feat: update tmux config
Signed-off-by: Anthony Oteri <4360016+anthonyoteri@users.noreply.github.com>
2026-03-10 19:27:55 -04:00

143 lines
5.0 KiB
Bash

# =============================================================
# Tmux Configuration - Gruvbox Dark, Vim Navigation, Fast Clipboard, Minimal Plugins
#
# Features:
# - Gruvbox dark theme for status bar and UI
# - Vim-style navigation and pane resizing
# - Mouse support and fast copy-paste
# - Minimal, fast plugin setup
# =============================================================
# Fast pane splitting shortcuts (already present)
# Copy-paste integration (already present with tmux-yank and set-clipboard)
# Plugin setup is minimal and fast with TPM and sensible plugins
# Additional: Make pane resizing easier with vim-style keys
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
# Gruvbox color palette
#set -g @gruvbox_fg '#ebdbb2'
#set -g @gruvbox_bg '#282828'
#set -g @gruvbox_yellow '#fabd2f'
#set -g @gruvbox_blue '#458588'
#set -g @gruvbox_red '#cc241d'
#set -g @gruvbox_green '#98971a'
#set -g @gruvbox_orange '#d79921'
# Status bar customization
set -g status-bg '#282828'
set -g status-fg '#ebdbb2'
set -g status-left-length 40
set -g status-right-length 100
set -g status-interval 2
set -g status-left "#[fg=#fabd2f,bg=#282828,bold] #S #[fg=#282828,bg=#fabd2f,nobold] #[fg=#ebdbb2,bg=#fabd2f] #(whoami)@#H #[fg=#fabd2f,bg=#282828] #[fg=#ebdbb2,bg=#282828] #(basename #{pane_current_path}) "
set -g status-right "#[fg=#fabd2f,bg=#282828]#[fg=#282828,bg=#fabd2f] #(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo '-') #[fg=#fabd2f,bg=#282828]#[fg=#ebdbb2,bg=#282828] %Y-%m-%d %H:%M "
# --- Terminal & Compatibility ---
# Use 256-color mode and ensure compatibility with xterm
set-option -g default-terminal 'screen-256color'
set-option -sa terminal-overrides ",xterm-256color:RGB"
# --- Mouse & Key Bindings ---
# Enable mouse support for pane/window selection and resizing
set -g mouse on
# (Optional) Change prefix to Ctrl+Space instead of default Ctrl+B
# Alt+Shift+H/L to switch windows (vim-style)
bind -n M-H previous-window
bind -n M-L next-window
# Start windows and panes at 1 for easier navigation
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# --- Miscellaneous ---
# Various usability and performance tweaks
set -g detach-on-destroy off # don't exit from tmux when closing a session
set -g escape-time 0 # zero-out escape time delay
set -g history-limit 1000000 # increase history size
set -g set-clipboard on # use system clipboard
set -g status-position top # macOS / darwin style
set -g default-terminal "${TERM}"
# --- Copy & Selection ---
# Use vi-style keys in copy mode
set-window-option -g mode-keys vi
# Keybindings for copy mode (vim-style selection and yanking)
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
# Split panes in the current working directory
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Use double lines for pane borders
set -g pane-border-lines double
# --- Plugins ---
# Plugin Manager (TPM) and useful plugins:
# tmux-plugins/tpm - Plugin manager
# tmux-plugins/tmux-sensible - Sensible defaults
# tmux-plugins/tmux-yank - Fast copy to clipboard
# tmux-plugins/tmux-resurrect - Save/restore sessions
# tmux-plugins/tmux-continuum - Auto-save sessions
# fcsonline/tmux-thumbs - Fuzzy select text
# sainnhe/tmux-fzf - Fuzzy find in tmux
# wfxr/tmux-fzf-url - Fuzzy find URLs
# egel/tmux-gruvbox - Gruvbox theme
# christoomey/vim-tmux-navigator - Vim navigation between panes
# omerxx/tmux-sessionx - Session management
# omerxx/tmux-floax - Floating windows
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'fcsonline/tmux-thumbs'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'wfxr/tmux-fzf-url'
#set -g @plugin 'egel/tmux-gruvbox'
set -g @plugin 'jimeh/tmux-themepack'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'omerxx/tmux-sessionx'
set -g @plugin 'omerxx/tmux-floax'
# Floax plugin settings (floating windows)
set -g @floax-width '80%'
set -g @floax-height '80%'
set -g @floax-bind 'p'
set -g @floax-change-path 'true'
# Sessionx plugin settings (session management)
set -g @sessionx-x-path '~/dotfiles'
set -g @sessionx-window-height '85%'
set -g @sessionx-window-width '75%'
set -g @sessionx-zoxide-mode 'on'
set -g @sessionx-custom-paths-subdirectories 'false'
set -g @sessionx-filter-current 'false'
# Continuum plugin: auto-restore sessions
set -g @continuum-restore 'on'
# Resurrect plugin: save/restore nvim sessions
set -g @resurrect-strategy-nvim 'session'
# Gruvbox theme plugin: use dark mode
#set -g @tmux-gruvbox 'dark'
set -g @themepack 'powerline/block/blue'
# Initialize TPM (Tmux Plugin Manager)
run '~/.tmux/plugins/tpm/tpm'