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