diff --git a/config/tmux/legacy.conf b/config/tmux/legacy.conf index 562a609..c420806 100644 --- a/config/tmux/legacy.conf +++ b/config/tmux/legacy.conf @@ -4,8 +4,11 @@ bind-key -t vi-copy PPage page-up bind-key -t vi-copy NPage page-down -bind-key -t vi-copy WheelUpPane halfpage-up -bind-key -t vi-copy WheelDownPane halfpage-down +# Mouse wheel scrolls 4 lines per tick, not tmux's half-page default (20 lines +# in a 40-line pane). Old bind-key has no -N; -R is the equivalent repeat +# count for keys in the copy-mode tables. +bind-key -R 4 -t vi-copy WheelUpPane scroll-up +bind-key -R 4 -t vi-copy WheelDownPane scroll-down bind-key -t vi-copy v begin-selection bind-key -t vi-copy y copy-pipe "$HOME/dotfiles/bin/clipboard-copy" unbind-key -t vi-copy Enter diff --git a/config/tmux/modern.conf b/config/tmux/modern.conf index b377a33..218b1ae 100644 --- a/config/tmux/modern.conf +++ b/config/tmux/modern.conf @@ -3,8 +3,11 @@ bind-key -T copy-mode-vi PPage send-keys -X page-up bind-key -T copy-mode-vi NPage send-keys -X page-down -bind-key -T copy-mode-vi WheelUpPane send-keys -X halfpage-up -bind-key -T copy-mode-vi WheelDownPane send-keys -X halfpage-down +# Mouse wheel scrolls 4 lines per tick, not tmux's half-page default (20 lines +# in a 40-line pane). -N is the repeat count; scroll-up/scroll-down take no +# direct amount argument and tmux resets the count after each command. +bind-key -T copy-mode-vi WheelUpPane send-keys -X -N 4 scroll-up +bind-key -T copy-mode-vi WheelDownPane send-keys -X -N 4 scroll-down bind-key -T copy-mode-vi v send-keys -X begin-selection bind-key -T copy-mode-vi y send-keys -X copy-pipe "$HOME/dotfiles/bin/clipboard-copy" unbind-key -T copy-mode-vi Enter