# Config Management
unbind r
bind r source-file ~/.tmux.conf \; display "Config reloaded."
# Control
set -g prefix C-space
set -g mouse on
# History
set-option -g history-limit 50000
# Numbering & Naming
set -g base-index 1
setw -g pane-base-index 1
set-option -g automatic-rename on
set-option -g automatic-rename-format '#{b:pane_current_path}'
# Windows
unbind W
bind-key W command-prompt -p "Window name:" "new-window -n '%%'" # New Window
bind-key t command-prompt -p "New name:" "rename-window '%%'" # Rename Window
# Switch Windows
bind-key 0 select-window -t 0
bind-key 1 select-window -t 1
bind-key 2 select-window -t 2
bind-key 3 select-window -t 3
bind-key 4 select-window -t 4
bind-key 5 select-window -t 5
bind-key 6 select-window -t 6
bind-key 7 select-window -t 7
bind-key 8 select-window -t 8
bind-key 9 select-window -t 9
# Panes
bind-key P command-prompt -p "Rename pane:" "select-pane -T '%%'"
bind x split-window -v
bind y split-window -h
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
# Theme
set -g @plugin 'catppuccin/tmux#v2.1.3'
run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux
# Options to make tmux more pleasant
set -g mouse on
set -g default-terminal "tmux-256color"
# Configure the catppuccin plugin
set -g @catppuccin_flavor "mocha"
set -g @catppuccin_window_status_style "rounded"
#----------------------------- Custom Theme
# Define color variables inspired by Catppuccin Mocha, mapped to HackTheBox colors
set -g @rosewater "#ffffff" # BrightWhite
set -g @flamingo "#ff8484" # BrightRed
set -g @pink "#c16cfa" # BrightPurple
set -g @mauve "#9f00ff" # Purple
set -g @red "#ff3e3e" # Red
set -g @maroon "#ff8484" # BrightRed
set -g @peach "#ffcc5c" # BrightYellow
set -g @yellow "#ffaf00" # Yellow
set -g @green "#9fef00" # Green
set -g @teal "#2ee7b6" # Cyan
set -g @sky "#5cecc6" # BrightCyan
set -g @sapphire "#5cb2ff" # BrightBlue
set -g @blue "#004cff" # Blue
set -g @lavender "#ffffff" #"#c16cfa" # BrightPurple
set -g @text "#a4b1cd" # Foreground
set -g @subtext1 "#666666" # BrightBlack
set -g @subtext0 "#313f55" # SelectionBackground
set -g @overlay2 "#666666" # BrightBlack
set -g @overlay1 "#313f55" # SelectionBackground
set -g @overlay0 "#313f55" # CursorColor
set -g @surface2 "#666666" # BrightBlack
set -g @surface1 "#313f55" # SelectionBackground
set -g @surface0 "#313f55" # CursorColor
set -g @base "#1a2332" # Background
set -g @mantle "#000000" # Black
set -g @crust "#000000" # Black
set -g @thm_bg "#1a2332"
# Plugins
set -g @plugin 'tmux-plugins/tmux-online-status'
set -g @plugin 'tmux-plugins/tmux-battery'
# Configure Online
set -g @online_icon "ok"
set -g @offline_icon "nok"
# Status bar position and transparency
set -g status-position bottom
set -g status-style "bg=#{@thm_bg},fg=#{@text}" # Transparent background
# Status left: Session name, pane command, and path
set -g status-left-length 100
set -g status-left ""
set -ga status-left "#{?client_prefix,#{#[bg=#{@red},fg=#{@base},bold] #S },#{#[bg=default,fg=#{@mauve}] #S }}"
set -ga status-left "#[bg=default,fg=#{@overlay0}] │ "
set -ga status-left "#[bg=default,fg=#{@blue}] #{pane_current_command} "
set -ga status-left "#[bg=default,fg=#{@overlay0}] │ "
set -ga status-left "#[bg=default,fg=#{@teal}] #{=/-32/...:#{s|$USER|~|:#{b:pane_current_path}}} "
set -ga status-left "#[bg=default,fg=#{@overlay0}]#{?window_zoomed_flag, │ ,}"
set -ga status-left "#[bg=default,fg=#{@yellow}]#{?window_zoomed_flag, zoom ,}"
# Status right: Battery, online status, VPN status, date/time
set -g status-right-length 100
set -g status-right ""
set -ga status-right "#{?#{e|>=:10,#{battery_percentage}},#{#[bg=#{@red},fg=#{@base}]},#{#[bg=default,fg=#{@peach}]}} #{battery_icon} #{battery_percentage} "
set -ga status-right "#[bg=default,fg=#{@overlay0}] │ "
set -ga status-right "#[bg=default]#{?#{==:#{online_status},ok},#[fg=#{@sapphire}] on ,#[fg=#{@red},bold] off }"
set -ga status-right "#[bg=default,fg=#{@overlay0}] │ "
set -ga status-right "#[bg=default,fg=#{@green}] #(~/vpn_status.sh) "
set -ga status-right "#[bg=default,fg=#{@overlay0}] │ "
set -ga status-right "#[bg=default,fg=#{@sky}] %Y-%m-%d %H:%M "
# Window status with rounded tabs and extra padding
set -g window-status-format "#[fg=#{@overlay0}]#[fg=#{@text},bg=#{@overlay0}] #I:#W #[fg=#{@overlay0},bg=default]"
set -g window-status-current-format "#[fg=#{@green}]#[fg=#{@base},bg=#{@green}] #I:#W #[fg=#{@green},bg=default]"
set -g window-status-style "bg=default"
set -g window-status-last-style "bg=default,fg=#{@green}"
set -g window-status-activity-style "bg=#{@red},fg=#{@base}"
set -g window-status-bell-style "bg=#{@red},fg=#{@base},bold"
set -gF window-status-separator " " # Add space between window tabs
# Pane borders
setw -g pane-border-status off # Hide pane border status
setw -g pane-active-border-style "bg=default,fg=#{@green}"
setw -g pane-border-style "bg=default,fg=#{@surface0}"
setw -g pane-border-lines single
# Automatic window renaming
set -wg automatic-rename on
set -g automatic-rename-format "Window"
# Justify window status
set -g status-justify "absolute-centre"
# Simulate bottom padding by adding a blank line
set -g status-format[1] ""
# Bootstrap tpm
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# Initialize TMUX plugin manager
run '~/.tmux/plugins/tpm/tpm'