Skip to content

Instantly share code, notes, and snippets.

@amonger
Created August 8, 2025 10:58
Show Gist options
  • Save amonger/b27b1cee19a3ed8b83784f6dce2f31fe to your computer and use it in GitHub Desktop.
Save amonger/b27b1cee19a3ed8b83784f6dce2f31fe to your computer and use it in GitHub Desktop.
tmux.conf
# Enable mouse support (for selecting and scrolling in each pane)
set -g mouse on
# Use vi-style keybindings in copy mode (optional, but recommended)
setw -g mode-keys vi
# Enable scroll with Shift-PageUp and Shift-PageDown too (optional)
bind -n S-PageUp copy-mode -u
bind -n S-PageDown send-keys -X page-down
##### General Settings #####
set -g mouse on
setw -g mode-keys vi
set -g history-limit 10000
# Start window index at 1
set -g base-index 1
setw -g pane-base-index 1
# Reload config with prefix + r
bind r source-file ~/.tmux.conf \; display "Config reloaded!"
##### Scrolling Behavior #####
bind -n S-PageUp copy-mode -u
bind -n S-PageDown send-keys -X page-down
##### Mouse Selection Behavior (pane-aware) #####
# Ensure mouse selection stays within the current pane
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
bind -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
# Fix mouse wheel scrolling to work per-pane
bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
##### macOS-Friendly Appearance #####
# Use a macOS-native looking font (set this in your Terminal/iTerm2 profile)
# Recommended fonts: JetBrains Mono, SF Mono, MesloLGS NF
# Set status bar with soft macOS-style colors
set -g status on
set -g status-interval 10
set -g status-justify centre
set -g status-style "bg=colour235,fg=white"
# Active window style
setw -g window-status-current-style "bg=colour240,fg=black,bold"
setw -g window-status-current-format " #I:#W "
# Inactive window style
setw -g window-status-style "bg=colour235,fg=colour244"
setw -g window-status-format " #I:#W "
# Pane border styles
set -g pane-border-style "fg=colour238"
set -g pane-active-border-style "fg=colour39"
# Message styling (e.g., prompts)
set -g message-style "bg=colour235,fg=white"
# Command prompt styling
set -g message-command-style "bg=colour238,fg=white"
##### Status Right (time and hostname) #####
set -g status-right "#[fg=colour244]#H #[fg=white]| %Y-%m-%d %H:%M"
##### Optional: UTF-8 and 256 color support #####
set -g utf8 on
set -g terminal-overrides "*:Tc"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment