dotfiles/.config/tmux/tmux.conf

96 lines
3.1 KiB
Bash

### General Settings
# Enable mouse support in tmux
set -g mouse on
# Set the default terminal type to "tmux-256color" for better color support
set -g default-terminal "tmux-256color"
# Set the base index for windows to 1 (instead of the default 0)
set -g base-index 1
# Set the base index for panes to 1 (instead of the default 0)
setw -g pane-base-index 1
# Increase the history limit (useful for longer command histories)
set-option -g history-limit 10000
### Startup Configuration
# Start a new session named "main" if none exists
new-session -s main
# Start htop and split the window when the session "main" is created
set-hook -t main session-created 'send-keys -t main:1 "sudo htop" C-m; split-window'
### Key Bindings
# Remap the prefix key from 'C-b' (Ctrl-b) to 'C-a' (Ctrl-a)
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Split panes using 'h' for horizontal and 'v' for vertical splits
bind "h" split-window -h
bind "v" split-window -v
unbind '"'
unbind %
# Reload the tmux configuration file with 'r'
bind r source-file $XDG_CONFIG_HOME/tmux/tmux.conf
### Status and Window Configuration
# Set the status bar update interval to 1 second
set -g status-interval 1
# Enable automatic renaming of windows
set-option -g automatic-rename on
# Set window title to the current directory if the process is zsh, otherwise show the process name with arguments
set-option -g automatic-rename-format '#{?#{==:#{pane_current_command},zsh},#(echo #{pane_current_path} | sed "s|^$HOME|~|"),#{pane_current_command}}'
# Set the color of the clock mode
set -g clock-mode-colour "#8bd5ca"
# Set the style for copy mode (foreground black, background a specific color, bold text)
set -g mode-style 'fg=black bg=#ed8796 bold'
# Set the style for pane borders
set -g pane-border-style 'fg=white'
set -g pane-active-border-style 'fg=#8bd5ca'
### Status Bar Configuration
# Position the status bar at the bottom
set -g status-position bottom
# Align status bar items to the left
set -g status-justify left
# Set the style for the status bar
set -g status-style 'fg=white,bg=#262626'
# Clear the default left status
set -g status-left ''
# Set the maximum length for the left status
set -g status-left-length 30
## Session name in the status bar
set -ga status-left "#[bg=#444444,fg=white] #S "
# Display different colors for the session name based on whether the prefix is active
set -ga status-left '#[fg=black]#{?client_prefix,#[bg=#ed8796] S ,#[bg=#a6da95] S }'
set -ga status-left '#[bg=#262626] '
# Set window status format to include the current directory or command
setw -g window-status-format '#[bg=#8787AF,fg=black] #I #[bg=#585B70,fg=white] #W #F '
# Set the current window status format to include the current directory or command
setw -g window-status-current-format '#[bg=#c6a0f6,fg=black] #I #[bg=#585B70,fg=white] #W #F '
# Set the separator between window statuses
set -g window-status-separator " "
# Status bar right settings (display host information)
set -g status-right "#[fg=black,bg=#7dc4e4] H #[fg=white,bg=brightblack] #H "
# Set the maximum length for the right status
set -g status-right-length 40