Skip to content

Instantly share code, notes, and snippets.

@IoTeacher
Last active February 16, 2026 04:46
Show Gist options
  • Select an option

  • Save IoTeacher/f9d03bc04ec094337e68b8308816ec85 to your computer and use it in GitHub Desktop.

Select an option

Save IoTeacher/f9d03bc04ec094337e68b8308816ec85 to your computer and use it in GitHub Desktop.
🍎 macOS-Optimized .tmux.conf

Perfect. Since you're on macOS, I’ll give you a fully macOS-compatible, stable, version-safe tmux config that:

  • βœ… Works on older macOS tmux versions
  • βœ… Avoids unsupported flags (swap-pane -L)
  • βœ… Uses macOS-compatible load display
  • βœ… Keeps everything fast and clean
  • βœ… Works even without Homebrew upgrade
  • βœ… TPM ready (optional)

🍎 macOS-Optimized .tmux.conf

Replace your current file completely with this:

##### ─────────────────────────────────────────────
#####  macOS-Compatible tmux Config
#####  Stable | Fast | Vim-Friendly | Clean UI
##### ─────────────────────────────────────────────


##### ─── PERFORMANCE ────────────────────────────

# Faster key response
set -sg escape-time 10

# Large scrollback
set -g history-limit 50000

# Enable focus events (safe on macOS)
set -g focus-events on

# Enable true color (macOS safe syntax)
set -g default-terminal "screen-256color"
set -as terminal-overrides ",*:Tc"


##### ─── PREFIX KEY ─────────────────────────────

# Change prefix to Ctrl-a
unbind C-b
set -g prefix C-a
bind C-a send-prefix

# Reload config
bind r source-file ~/.tmux.conf \; display-message "Config Reloaded βœ”"


##### ─── PANE MANAGEMENT ────────────────────────

# Split panes
bind | split-window -h
bind - split-window -v

# Vim-style navigation
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# Resize panes
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

# Compatible pane swapping (works on older macOS tmux)
bind -r C-h swap-pane -s '{left-of}'
bind -r C-l swap-pane -s '{right-of}'


##### ─── COPY MODE (VIM STYLE) ───────────────────

setw -g mode-keys vi

bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send -X copy-selection-and-cancel

# macOS clipboard integration
set -g set-clipboard on


##### ─── MOUSE SUPPORT ───────────────────────────

set -g mouse on


##### ─── WINDOW SETTINGS ────────────────────────

set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on


##### ─── STATUS BAR (macOS-safe load display) ───

set -g status-position top
set -g status-interval 5

# Colors
set -g status-style bg=#1e1e2e,fg=#cdd6f4
set -g window-status-style fg=#6c7086,bg=#1e1e2e
set -g window-status-current-style fg=#1e1e2e,bg=#89b4fa,bold

# Left side
set -g status-left-length 40
set -g status-left "#[fg=#89b4fa] #S "

# Right side (macOS compatible uptime parsing)
set -g status-right-length 100
set -g status-right "#[fg=#a6e3a1]#(sysctl -n vm.loadavg | awk '{print $2,$3,$4}') #[fg=#fab387]%H:%M #[fg=#89dceb]#H "

# Pane borders
set -g pane-border-style fg=#6c7086
set -g pane-active-border-style fg=#89b4fa


##### ─── TPM (Optional Plugin Manager) ──────────

# Comment these out if you don't want plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'

run '~/.tmux/plugins/tpm/tpm'


##### ─────────────────────────────────────────────
#####  END
##### ─────────────────────────────────────────────

πŸ›  If You Don’t Use TPM

Comment out this entire section:

set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
run '~/.tmux/plugins/tpm/tpm'

Otherwise install TPM:

brew install tmux   # optional upgrade
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

Then inside tmux:

Ctrl-a + I

πŸ”„ Reload It

Inside tmux:

Ctrl-a r

πŸ’‘ macOS Pro Tip

If colors look wrong in iTerm2:

  • Preferences β†’ Profiles β†’ Terminal
  • Set $TERM to:
xterm-256color

@IoTeacher

Copy link
Copy Markdown
Author

Two fully macOS-compatible, production-safe themes:

  • πŸŒƒ Tokyo Night (Storm variant) – clean, cool, professional
  • 🐱 Catppuccin Mocha – warm, modern, aesthetic

Both:

  • Work on macOS default tmux
  • Require no bleeding-edge features
  • Are optimized for iTerm2 / Apple Terminal
  • Keep performance intact

You can paste one directly into ~/.tmux.conf (replace your status section).


πŸŒƒ TOKYO NIGHT (Storm Variant)

Replace your STATUS BAR section with this:

##### ─── TOKYO NIGHT THEME ─────────────────────

# Status bar
set -g status-position top
set -g status-interval 5
set -g status-style bg=#24283b,fg=#c0caf5

# Window styling
set -g window-status-style fg=#565f89,bg=#24283b
set -g window-status-current-style fg=#1a1b26,bg=#7aa2f7,bold

# Pane borders
set -g pane-border-style fg=#414868
set -g pane-active-border-style fg=#7aa2f7

# Left side (session)
set -g status-left-length 40
set -g status-left "#[fg=#7aa2f7,bold] #S "

# Right side (macOS load + time + host)
set -g status-right-length 100
set -g status-right "#[fg=#9ece6a]#(sysctl -n vm.loadavg | awk '{print $2,$3,$4}') #[fg=#e0af68]%H:%M #[fg=#bb9af7]#H "

🎨 Color Identity

  • Background: Deep blue-gray
  • Accent: Electric blue
  • Info: Soft green
  • Time: Warm amber
  • Host: Purple

Professional. Clean. Focused.


🐱 CATPPUCCIN (Mocha Variant)

Replace status section with:

##### ─── CATPPUCCIN MOCHA THEME ─────────────────

# Status bar
set -g status-position top
set -g status-interval 5
set -g status-style bg=#1e1e2e,fg=#cdd6f4

# Window styling
set -g window-status-style fg=#6c7086,bg=#1e1e2e
set -g window-status-current-style fg=#1e1e2e,bg=#89b4fa,bold

# Pane borders
set -g pane-border-style fg=#45475a
set -g pane-active-border-style fg=#f38ba8

# Left side (session)
set -g status-left-length 40
set -g status-left "#[fg=#89b4fa,bold] #S "

# Right side (macOS load + time + host)
set -g status-right-length 100
set -g status-right "#[fg=#a6e3a1]#(sysctl -n vm.loadavg | awk '{print $2,$3,$4}') #[fg=#fab387]%H:%M #[fg=#f5c2e7]#H "

🎨 Color Identity

  • Background: Dark lavender
  • Active window: Sky blue
  • Borders: Pink accent
  • Load: Mint green
  • Time: Peach
  • Host: Soft pink

Aesthetic. Calm. Modern.


🍎 macOS Optimization Tip

For perfect colors:

iTerm2:

  • Profiles β†’ Terminal
  • Set $TERM to:
xterm-256color

Apple Terminal:

True color works fine, but iTerm2 looks better with these palettes.


@IoTeacher

Copy link
Copy Markdown
Author

Now we’re stepping into true power-user territory.

This config is designed specifically for:

  • 🍎 macOS
  • 🍺 Homebrew tmux (3.4+)
  • ⚑ True color
  • 🧠 Popup workflows
  • 🧩 Modular structure
  • πŸ”Œ Plugin ecosystem
  • πŸͺ„ Smart session + workspace automation
  • πŸš€ Maximum keyboard efficiency

Before using this, confirm:

tmux -V

You want 3.4 or newer.


πŸš€ Advanced Homebrew tmux 3.4+ Power Config

Replace your entire ~/.tmux.conf with this:

##### ════════════════════════════════════════════════
#####  TMUX 3.4+ POWER CONFIG (macOS + Homebrew)
#####  Popup-driven | Truecolor | Modular | Fast
##### ════════════════════════════════════════════════


##### ─── CORE PERFORMANCE ─────────────────────────

set -sg escape-time 0
set -g history-limit 200000
set -g focus-events on
set -g set-clipboard on

# True color (modern)
set -g default-terminal "tmux-256color"
set -as terminal-overrides ",*:RGB"

set -g assume-paste-time 1


##### ─── PREFIX & LEADER ──────────────────────────

unbind C-b
set -g prefix C-a
bind C-a send-prefix

bind r source-file ~/.tmux.conf \; display-message "⚑ Config Reloaded"


##### ─── WINDOW & INDEXING ────────────────────────

set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
set -g detach-on-destroy off


##### ─── VIM-STYLE NAVIGATION ─────────────────────

setw -g mode-keys vi

bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"

bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

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

# Smart pane swapping (3.4+)
bind -r C-h swap-pane -L
bind -r C-l swap-pane -R


##### ─── POPUP WORKFLOWS (3.4+) ───────────────────

# Session switcher (fzf required)
bind s display-popup -E -w 80% -h 70% \
"tmux list-sessions | cut -d: -f1 | fzf --reverse | xargs tmux switch-client -t"

# New session popup
bind n display-popup -E -w 60% -h 30% \
"read -p 'Session name: ' name; tmux new-session -d -s \$name"

# Kill session popup
bind X display-popup -E -w 60% -h 30% \
"tmux list-sessions | cut -d: -f1 | fzf | xargs tmux kill-session -t"


##### ─── COPY MODE ENHANCEMENTS ───────────────────

bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send -X copy-selection-and-cancel
bind -T copy-mode-vi r send -X rectangle-toggle

set -g mouse on


##### ─── SMART STATUS BAR (Tokyo Night Inspired) ─

set -g status-position top
set -g status-interval 3
set -g status-style bg=#1a1b26,fg=#c0caf5

set -g pane-border-style fg=#414868
set -g pane-active-border-style fg=#7aa2f7

set -g window-status-style fg=#565f89,bg=#1a1b26
set -g window-status-current-style fg=#1a1b26,bg=#7aa2f7,bold

set -g status-left-length 50
set -g status-left "#[fg=#7aa2f7,bold] #S "

set -g status-right-length 150
set -g status-right "#[fg=#9ece6a]#(sysctl -n vm.loadavg | awk '{print $2,$3,$4}') \
#[fg=#e0af68]%H:%M \
#[fg=#bb9af7]#H"


##### ─── MESSAGE STYLING ──────────────────────────

set -g message-style bg=#1a1b26,fg=#7aa2f7
set -g message-command-style bg=#1a1b26,fg=#e0af68


##### ─── TPM PLUGIN ECOSYSTEM ─────────────────────

set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'on'

run '~/.tmux/plugins/tpm/tpm'


##### ════════════════════════════════════════════════
##### END
##### ════════════════════════════════════════════════

🍺 Homebrew Setup Checklist

If you haven’t upgraded:

brew install tmux

Make sure you're using it:

which tmux

Should be:

/opt/homebrew/bin/tmux

If not, add to your shell:

export PATH="/opt/homebrew/bin:$PATH"

πŸ”Œ Install Plugins

git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

Inside tmux:

Ctrl-a + I

🧠 What Makes This β€œPower” Tier?

βœ” Zero key delay
βœ” True RGB
βœ” Popup session manager
βœ” Smart pane path inheritance
βœ” Massive scrollback
βœ” Auto session restore
βœ” Vim-native ergonomics
βœ” Modern theme
βœ” High refresh status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment