139 lines
5.6 KiB
Text
139 lines
5.6 KiB
Text
# ==============================================
|
|
# === TMUX Configuration ===
|
|
# ==============================================
|
|
|
|
# General Settings
|
|
# ----------------
|
|
set -g prefix C-a # Use CTRL+a as our tmux command prefix
|
|
unbind C-b # Unbind default prefix
|
|
set -g base-index 1 # Start windows numbering at 1
|
|
setw -g pane-base-index 1 # Start pane numbering at 1
|
|
set -g renumber-windows on # Renumber windows when a window is closed
|
|
set -s escape-time 1 # Lower the default tmux delay
|
|
set -g mouse on # Enable mouse support
|
|
setw -g aggressive-resize on # Only resize screen if smaller screen is active
|
|
set -g history-limit 10000 # Store 10k lines of history
|
|
set-option -g allow-rename off # Disable automatic window renaming
|
|
set-option -s set-clipboard on # Enable clipboard support
|
|
setw -g mode-keys vi # Use vi keys in copy mode
|
|
|
|
|
|
# Key Bindings
|
|
# ------------
|
|
bind r source-file $XDG_CONFIG_HOME/tmux/tmux.conf \; display "tmux reloaded!" # Reload config
|
|
bind v split-window -h -c "#{pane_current_path}" # Split vertically
|
|
bind s split-window -v -c "#{pane_current_path}" # Split horizontally
|
|
|
|
# Vim-like pane navigation
|
|
bind h select-pane -L
|
|
bind j select-pane -D
|
|
bind k select-pane -U
|
|
bind l select-pane -R
|
|
|
|
# Vim-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
|
|
|
|
# Vim-like copy mode navigation
|
|
bind-key -T copy-mode-vi h send-keys -X cursor-left
|
|
bind-key -T copy-mode-vi j send-keys -X cursor-down
|
|
bind-key -T copy-mode-vi k send-keys -X cursor-up
|
|
bind-key -T copy-mode-vi l send-keys -X cursor-right
|
|
bind-key -T copy-mode-vi w send-keys -X next-word
|
|
bind-key -T copy-mode-vi b send-keys -X previous-word
|
|
bind-key -T copy-mode-vi 0 send-keys -X start-of-line
|
|
bind-key -T copy-mode-vi $ send-keys -X end-of-line
|
|
bind-key -T copy-mode-vi G send-keys -X history-bottom
|
|
bind-key -T copy-mode-vi g send-keys -X history-top
|
|
bind-key -T copy-mode-vi / command-prompt -T search -I "#{pane_current_path}" "send -X search-forward \"%%\""
|
|
bind-key -T copy-mode-vi ? command-prompt -T search -I "#{pane_current_path}" "send -X search-backward \"%%\""
|
|
bind-key -T copy-mode-vi n send-keys -X search-again
|
|
bind-key -T copy-mode-vi N send-keys -X search-reverse
|
|
bind-key -T copy-mode-vi v send-keys -X begin-selection
|
|
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
|
|
bind-key -T copy-mode-vi Escape send-keys -X cancel
|
|
|
|
# Move pane to a different window
|
|
bind-key m choose-window -F "#{window_index}: #{window_name}" "join-pane -h -t %%"
|
|
bind-key M choose-window -F "#{window_index}: #{window_name}" "join-pane -v -t %%"
|
|
|
|
# Visual Settings
|
|
# ---------------
|
|
set -g status-interval 2
|
|
set-option -g visual-activity off
|
|
set-option -g visual-bell off
|
|
set-option -g visual-silence off
|
|
set-window-option -g monitor-activity off
|
|
set-option -g bell-action none
|
|
|
|
# Terminal Settings
|
|
# -----------------
|
|
set -gq allow-passthrough on
|
|
set -g visual-activity off
|
|
|
|
set -ga update-environment TERM
|
|
set -ga update-environment TERM_PROGRAM
|
|
set -g default-terminal "tmux-256color"
|
|
set -g terminal-overrides ',xterm-256color:Tc'
|
|
|
|
# Plugins
|
|
# -------
|
|
set -g @plugin 'tmux-plugins/tpm'
|
|
set -g @plugin 'tmux-plugins/tmux-sensible'
|
|
set -g @plugin 'tmux-plugins/tmux-yank'
|
|
set -g @plugin 'rose-pine/tmux'
|
|
set -g @plugin 'tmux-plugins/tmux-battery' # Re-enabled with our fixes
|
|
set -g @plugin 'MaximilianGaedig/tmux-filter'
|
|
|
|
# Plugin Settings
|
|
# ---------------
|
|
set -g @yank_selection_mouse 'clipboard'
|
|
set -g @yank_selection 'clipboard'
|
|
set -g @yank_action 'copy-pipe' # or 'copy-pipe-and-cancel' for the default
|
|
|
|
# Rosé Pine Theme Configuration
|
|
# -----------------------------
|
|
set -g status-position top
|
|
set -g @rose_pine_variant 'main' # Options are 'main', 'moon' or 'dawn'
|
|
|
|
# Enable extra modules
|
|
set -g @rose_pine_host 'on' # Enables hostname in the status bar
|
|
set -g @rose_pine_hostname_short 'on' # Makes the hostname shorter by using tmux's '#h' format
|
|
set -g @rose_pine_date_time '%Y-%m-%d %H:%M:%S' # Date/time format
|
|
set -g @rose_pine_user 'on' # Turn on the username component in the statusbar
|
|
set -g @rose_pine_directory 'on' # Turn on the current folder component in the status bar
|
|
set -g @rose_pine_bar_bg_disable 'on' # Disables background color, for transparent terminal emulators
|
|
|
|
# Battery module - determine if battery is available
|
|
run-shell "if [ -d /sys/class/power_supply/BAT* ]; then \
|
|
tmux set -g @rose_pine_status_right_append_section '#{tmux_battery_status_bg}'; \
|
|
fi"
|
|
|
|
# Battery Icons (Glyphs)
|
|
set -g @batt_icon_charge_tier8 ''
|
|
set -g @batt_icon_charge_tier7 ''
|
|
set -g @batt_icon_charge_tier6 ''
|
|
set -g @batt_icon_charge_tier5 ''
|
|
set -g @batt_icon_charge_tier4 ''
|
|
set -g @batt_icon_charge_tier3 ''
|
|
set -g @batt_icon_charge_tier2 ''
|
|
set -g @batt_icon_charge_tier1 ''
|
|
|
|
# Optional customization options
|
|
# set -g @rose_pine_left_separator ' > '
|
|
# set -g @rose_pine_right_separator ' < '
|
|
# set -g @rose_pine_field_separator ' | '
|
|
set -g @rose_pine_window_separator ' #{?window_zoomed_flag, ,}' # Replaces the default `:` between the window number and name
|
|
|
|
# Plugin Manager
|
|
set-environment -g TMUX_PLUGIN_MANAGER_PATH "$XDG_DATA_HOME/tmux/plugins"
|
|
|
|
# Install TPM if not already installed
|
|
if "test ! -d ~/.local/share/tmux/plugins/tpm" \
|
|
"run 'git clone https://github.com/tmux-plugins/tpm ~/.local/share/tmux/plugins/tpm'"
|
|
|
|
# Initialize TPM (keep this line at the very bottom of tmux.conf)
|
|
run '~/.local/share/tmux/plugins/tpm/tpm'
|
|
|