Skip to content

Instantly share code, notes, and snippets.

@prime-hacker
Created May 16, 2026 15:50
Show Gist options
  • Select an option

  • Save prime-hacker/374b57fa9efbb8488dd0ded59d5284fc to your computer and use it in GitHub Desktop.

Select an option

Save prime-hacker/374b57fa9efbb8488dd0ded59d5284fc to your computer and use it in GitHub Desktop.
# NEEDED FOR THIS TO RUN PROPERLY IN MACOS:
# 1. Install Homebrew tools: brew install tmux-mem-cpu-load
# 2. TMUX Plugin Manager (https://github.com/tmux-plugins/tpm)
# 3. Type (your prefix + I) to install the plugins
set-option -g prefix C-a
# Command Sequence for Nested Tmux Sessions
bind-key a send-prefix
# Set the base index for windows to 1 instead of 0
set -g base-index 1
set -g default-terminal "tmux-256color"
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
# Set the base index for panes to 1 instead of 0
set -g pane-base-index 1
# Setting the delay between prefix and command
set -s escape-time 5
# Set bind key to reload configuration file
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Splitting panes with | and -
bind | split-window -h
bind - split-window -v
# Enable mouse support
set -g mouse on
# Pane Navigation (Ensure Alt/Option is set to Esc+ in your Terminal emulator)
bind -n m-Left select-pane -L
bind -n m-Right select-pane -R
bind -n m-Up select-pane -U
bind -n m-Down select-pane -D
setw -g mode-key vi
set-option -s set-clipboard off
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
unbind -T copy-mode-vi Enter
## Adapted for macOS Native Clipboard (pbcopy)
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'pbcopy' \; display-message "Copied to Clipboard"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'pbcopy' \; display-message "Copied to Clipboard"
# ==========================================
# NATIVE MACOS TERMINAL INHERITED THEME
# ==========================================
# Active and inactive pane blending (inherits terminal background)
set -g window-style 'fg=default,bg=default'
set -g window-active-style 'fg=default,bg=default'
# Subtle, adaptive pane borders
set -g pane-border-style fg=colour7
set -g pane-active-border-style fg=default
# Command prompt message text styling
set -g message-style bg=default,fg=default,reverse
# Status bar alignment and core colors
set -g status-style bg=default,fg=default
set -g status-interval 1
# Status Left: Simple symbol that scales with light/dark themes
set -g status-left '#[fg=default,bold]#{?client_prefix,#[reverse],} ☺ '
set -ga status-left '#[fg=default]#{?window_zoomed_flag, ↕ , }'
# Window status format (Clean textual style matching native macOS design)
set-window-option -g window-status-style fg=default,bg=default,dim
set-window-option -g window-status-current-style fg=default,bg=default,bold
set -g window-status-format " #I:#W "
set -g window-status-current-format " #[reverse] #I:#W #[noreverse] "
# Status Right: System Stats + Date/Time (Adapted to look seamless without colored arrows)
set -g status-right '#[fg=default] #(tmux-mem-cpu-load -g 0 --interval 2) '
set -ga status-right ' | #(uptime | awk -F "up " "{print \$2}" | cut -d "," -f 1-2) '
set -ga status-right ' | %a %H:%M:%S | %Y-%m-%d '
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Initialize TMUX plugin manager
run '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment