Skip to content

Instantly share code, notes, and snippets.

@Sy3Omda
Created August 8, 2026 16:54
Show Gist options
  • Select an option

  • Save Sy3Omda/71a89071fa8b7fb280f28d20bbd2d44d to your computer and use it in GitHub Desktop.

Select an option

Save Sy3Omda/71a89071fa8b7fb280f28d20bbd2d44d to your computer and use it in GitHub Desktop.

Oh My Tmux! macOS Configuration

A customized gpakosz/.tmux setup optimized for macOS with native clipboard integration, vi mode, and screen-like keybindings.

Features

  • Prefix: Ctrl+a (screen-style)
  • Copy Mode: Full vi bindings with macOS clipboard sync
  • Navigation: Ctrl+a n/p for windows, hjkl for panes
  • Mouse: Enabled with auto-copy on selection
  • Theme: Powerline-inspired status bar

Prerequisites

# Install tmux
brew install tmux

# Required for clipboard integration
brew install reattach-to-user-namespace

# Optional: Nerd Font for icons
brew tap homebrew/cask-fonts
brew install --cask font-meslo-lg-nerd-font

Installation

# Backup existing config
cp ~/.tmux.conf ~/.tmux.conf.backup 2>/dev/null || true

# Clone Oh My Tmux
git clone --single-branch https://github.com/gpakosz/.tmux.git ~/.tmux

# Create symlinks
ln -s -f ~/.tmux/.tmux.conf ~/.tmux.conf

# Copy and customize local config
cp ~/.tmux/.tmux.conf.local ~/.tmux.conf.local

Configuration

Edit ~/.tmux.conf.local and replace the user customizations section with:

# -- user customizations -------------------------------------------------------

# Increase history
set -g history-limit 10000

# Enable mouse
set -g mouse on

# Vi mode
set -g status-keys vi
setw -g mode-keys vi

# Prefix: Ctrl+a (screen-style)
set -gu prefix2
unbind C-a
unbind C-b
set -g prefix C-a
bind C-a send-prefix

# Window navigation
bind n next-window
bind p previous-window
bind C-n next-window
bind C-p previous-window
bind c new-window
bind , command-prompt -I "#W" "rename-window '%%'"

# Vi copy mode bindings
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi V send-keys -X select-line
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi Escape send-keys -X cancel

# macOS native clipboard
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"

# Enter copy mode with prefix + v
bind v copy-mode

Terminal Setup

iTerm2 (Recommended)

  1. Font: Settings → Profiles → Text → Font → Select "MesloLGS NF"
  2. Clipboard: Settings → General → Selection → Check "Applications in terminal may access clipboard"
  3. Option Key: Settings → Profiles → Keys → Left Option = "Esc+"

Terminal.app

  1. Font: Settings → Profiles → Text → Font → Select "MesloLGS NF"
  2. Option Key: Settings → Profiles → Keyboard → Check "Use Option as Meta key"

Key Bindings

Action Shortcut
Prefix Ctrl+a
New window Ctrl+a c
Next/previous window Ctrl+a n / Ctrl+a p
Window by number Ctrl+a 0-9
Split horizontal Ctrl+a |
Split vertical Ctrl+a -
Navigate panes Ctrl+a h/j/k/l
Resize panes Ctrl+a H/J/K/L
Enter copy mode Ctrl+a [ or Ctrl+a v
Start selection v (in copy mode)
Copy y (in copy mode)
Paste Ctrl+a ]
Reload config Ctrl+a r
Edit config Ctrl+a e

Copy Mode Quick Reference

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