Files
2026-04-29 10:26:50 -04:00

90 lines
3.3 KiB
Bash

# 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
# Status bar customization
set -g status-bg '#1e1e2e'
set -g status-fg '#cdd6f4'
set -g status-left-length 40
set -g status-right-length 100
set -g status-interval 2
set -g status-left "#[fg=#1e1e2e,bg=#cba6f7,bold] #S #[fg=#cba6f7,bg=#74c7ec,nobold]#[fg=#1e1e2e,bg=#74c7ec,bold] #(whoami)@#H #[fg=#74c7ec,bg=#313244,nobold]#[fg=#cdd6f4,bg=#313244] #(basename #{pane_current_path}) #[fg=#313244,bg=default,nobold]"
set -g status-right "#[fg=#b4befe,bg=default]#[fg=#1e1e2e,bg=#b4befe,bold] #(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo '-') #[fg=#313244,bg=#b4befe,nobold]#[fg=#cdd6f4,bg=#313244] %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
# Reduce scroll speed (3 lines per notch)
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -N 3 Up'"
bind -n WheelDownPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'send-keys -N 3 Down'"
# (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:
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'catppuccin/tmux#v2.1.3'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'fcsonline/tmux-thumbs'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'wfxr/tmux-fzf-url'
set -g @plugin 'christoomey/vim-tmux-navigator'
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'
# Theme settings
set -g @catppuccin_flavor 'mocha'
# Initialize TPM (Tmux Plugin Manager)
run '~/.tmux/plugins/tpm/tpm'