Created
March 25, 2023 13:48
-
-
Save HirogaKatageri/31e13d9a3ea36b2db1410c3e18829542 to your computer and use it in GitHub Desktop.
Tmux Config for MacOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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