Skip to content

Instantly share code, notes, and snippets.

@HirogaKatageri
Created March 25, 2023 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HirogaKatageri/31e13d9a3ea36b2db1410c3e18829542 to your computer and use it in GitHub Desktop.
Save HirogaKatageri/31e13d9a3ea36b2db1410c3e18829542 to your computer and use it in GitHub Desktop.
Tmux Config for MacOS
# Use 'reattach-to-user-namespace' to enable copy & paste using clipboard.
if command -v reattach-to-user-namespace >/dev/null 2>&1; then
alias pbcopy='reattach-to-user-namespace pbcopy'
alias pbpaste='reattach-to-user-namespace pbpaste'
fi
# Set prefix to ctrl+a
unbind C-b
set-option -g prefix C-a
# Enable vi keys mode
set-window-option -g mode-keys vi
# Enable Copy & Paste
set -g default-command "reattach-to-user-namespace -l ${SHELL}"
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel 'pbcopy'
bind-key p paste-buffer
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'pbcopy'
# Split lanes using '\' & '-'
bind '\' split-window -h
bind - split-window -v
unbind '"'
unbind %
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
# Quick reload
bind r source-file ~/.tmux.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment