Files
dotfiles/tmux/.tmux.conf
2024-12-22 15:34:14 +01:00

60 lines
1.8 KiB
Bash

# Reset prefix to Ctrl-b
unbind C-a # Unbind any custom prefixes (e.g., Ctrl-a)
set-option -g prefix C-b
bind C-b send-prefix # Ensure Ctrl-b works as the prefix
# Sensible Defaults
set -g mouse on # Enable mouse support
set -g history-limit 10000 # Large scrollback history
setw -g automatic-rename off # Keep pane names static
set -g base-index 1 # Pane numbering starts at 1
setw -g pane-base-index 1 # Pane numbering starts at 1
set-option -g status-keys vi # Use vi-style keybindings
# Status Bar Customization
set -g status off
set -g status-bg black
set -g status-fg white
set -g status-interval 5
# Left: Session name
set -g status-left "#S "
# Right: Time and date
set -g status-right "%H:%M | %d-%b-%Y"
# Window options
setw -g window-status-format " #I:#W "
setw -g window-status-current-format " #I:#W "
setw -g window-status-separator ""
# Key Bindings
bind r source-file ~/.config/tmux/.tmux.conf \; display-message "Config Reloaded"
bind \\ split-window -h # Split panes horizontally
bind - split-window -v # Split panes vertically
bind h select-pane -L # Move between panes
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Resize panes
bind -r C-h resize-pane -L 5
bind -r C-j resize-pane -D 5
bind -r C-k resize-pane -U 5
bind -r C-l resize-pane -R 5
# Copy Mode
setw -g mode-keys vi # Vi copy mode
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-selection \; send-keys -X cancel
# Plugins (optional)
set -g @plugin 'tmux-plugins/tpm' # Tmux Plugin Manager
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'tmux-plugins/tmux-powerline'
# Initialize plugins
run '/opt/homebrew/opt/tpm/share/tpm/tpm'