From b7e635fe69168cc995002901cb2b28192fe733d5 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Fri, 31 Jul 2015 23:00:25 +0200 Subject: [PATCH] use vim keybindings in copy mode --- tmux.conf | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tmux.conf b/tmux.conf index 772db99..0aa43df 100644 --- a/tmux.conf +++ b/tmux.conf @@ -17,11 +17,16 @@ unbind C-b set -g prefix C-a bind C-a send-prefix -# Copy-paste integration +# Use vim keybindings in copy mode setw -g mode-keys vi -bind -t vi-copy 'v' begin-selection -bind -t vi-copy 'y' copy-selection -bind y run-shell "tmux show-buffer | xclip -sel clip -i" \; display-message "Copied tmux buffer to system clipboard" + +# Setup 'v' to begin selection as in Vim +bind-key -t vi-copy v begin-selection +bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" + +# Update default binding of `Enter` to also use copy-pipe +unbind -t vi-copy Enter +bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy" # splitting panes bind v split-window -h