From faefdf26685a07b65bf55731088a24450ffc2b4d Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 31 Aug 2017 17:08:42 +0300 Subject: [PATCH] .tmux.conf: Improve copy mode bindings Use vi mode-keys. Add/fix vi-copy bindings. Remove emacs-copy bindings. --- .tmux.conf | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 2185759..c88fd3b 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -4,6 +4,8 @@ set-option -g pane-base-index 1 # Renumber windows sequentially after closing any of them set-option -g renumber-windows on +# Keyboard +set-window-option -g mode-keys vi # Pass [Ctrl]+[PgUp/PgDn] set-window-option -g xterm-keys on @@ -87,10 +89,12 @@ bind -r C-l select-window -t :+ bind-key | split-window -h bind-key - split-window -v +bind-key -t vi-copy v begin-selection +bind-key -t vi-copy y copy-selection +bind-key -t vi-copy r rectangle-toggle +bind P paste-buffer + # Copy tmux copy buffer to X clipboard -# bind C-y run-shell "tmux save-buffer - | xclip -i" -bind -t emacs-copy C-p copy-pipe "xsel -i -p && xsel -o -p | xsel -i -b" -bind -t vi-copy C-p copy-pipe "xsel -i -p && xsel -o -p | xsel -i -b" +bind -t vi-copy C-y copy-pipe "xclip -i" # Copy X clipboard to tmux paste buffer -# bind C-p run-shell "xclip -o | tmux load-buffer -; tmux paste-buffer" -bind C-y run-shell "xsel -o | tmux load-buffer - ; tmux paste-buffer" +bind C-p run-shell "xclip -o | tmux load-buffer -; tmux paste-buffer" -- 2.39.5