From d5fdfd37e976070c340fc783bb38312d275aea69 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Fri, 24 Jun 2022 16:47:34 +0200 Subject: [PATCH] tmux: Do not auto exit copy-mode when at bottom Do not exit automatically the copy-mode when reaching the bottom. This was especially annoying/dangerous when holding `C-d` down to scroll to the bottom. --- .config/tmux/tmux.conf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index 6eabb8a..17a8636 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -12,6 +12,14 @@ bind-key -T copy-mode-vi MouseDragEnd1Pane \ # https://github.com/neovim/neovim/wiki/FAQ#cursor-shape-doesnt-change-in-tmux set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' +# Do not exit automatically the copy-mode when reaching the bottom. This was +# especially annoying/dangerous when holding C-d down to scroll to the bottom. +# (This is practically the default binding except for the `-e` flag for +# `copy-mode`) +bind -n WheelUpPane if -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send -M } { copy-mode -u } +bind -T copy-mode-vi WheelUpPane select-pane \; send-keys -XN5 scroll-up +bind -T copy-mode-vi WheelDownPane select-pane \; send-keys -XN5 scroll-down + # Set C-a as new prefix unbind C-b set-option -g prefix C-a