From 70f41b2f92706697cbe7d5efc9c503a2748c0b4f Mon Sep 17 00:00:00 2001 From: talksik Date: Sat, 5 Aug 2023 10:46:26 -0700 Subject: [PATCH] copy paste properly working --- .tmux.conf | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.tmux.conf b/.tmux.conf index 5a85a38..875f57f 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -56,3 +56,22 @@ bind r source-file ~/.tmux.conf # bottom right status bar that highlights when prefix active set -g status-right ' #{?client_prefix,#[reverse]#[noreverse] ,}"#{=21:pane_title}" %H:%M %d-%b-%y' + + +bind P paste-buffer + +# Enable mouse & Copy/Paste - Requirements: xclip +set -g mouse on +bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'" +bind -n WheelDownPane select-pane -t= \; send-keys -M +bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M +bind -T copy-mode-vi C-WheelUpPane send-keys -X halfpage-up +bind -T copy-mode-vi C-WheelDownPane send-keys -X halfpage-down +bind -T copy-mode-emacs C-WheelUpPane send-keys -X halfpage-up +bind -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down +# # Use vim keybindings in copy mode +setw -g mode-keys vi +# Update default binding of `Enter` to also use copy-pipe +unbind -T copy-mode-vi Enter +bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection c" +bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"