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.
This commit is contained in:
2022-06-24 16:47:34 +02:00
parent c906c5ffb6
commit d5fdfd37e9

View File

@@ -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