From c784ab00e0e7791cccaa95b962d09ed07d46bfe8 Mon Sep 17 00:00:00 2001 From: Kevin Yap Date: Fri, 24 Jun 2016 13:39:01 -0700 Subject: [PATCH] Add clipboard support to tmux on macOS --- Brewfile | 1 + link/.tmux.conf | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Brewfile b/Brewfile index 4fc1612..0afc329 100644 --- a/Brewfile +++ b/Brewfile @@ -24,6 +24,7 @@ brew 'readline' brew 'the_silver_searcher' brew 'tmux' brew 'tree' +brew 'reattach-to-user-namespace' # copy-paste for tmux brew 'vim' brew 'wget' brew 'z' diff --git a/link/.tmux.conf b/link/.tmux.conf index cd6f2bd..6767585 100644 --- a/link/.tmux.conf +++ b/link/.tmux.conf @@ -3,6 +3,7 @@ set -g default-terminal "screen-256color" set -g history-limit 10000 set -sg escape-time 1 set -g mouse on +set -g base-index 1 setw -g mode-keys vi # Don't rename windows automatically @@ -16,6 +17,12 @@ bind-key C-a send-prefix # Fully clear history using `C-l`, `C-k` bind -n C-k clear-history +# Copy/paste on macOS +bind-key -t vi-copy v begin-selection +bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" +unbind -t vi-copy Enter +bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy" + # Reload ~/.tmux.conf using `C-a r` bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf" -- 2.51.2