tmux - scroll up/down with shift + page up/down into a pane

Here's a solution that should just work with your muscle memory, allowing you to use Shift+PageUp and Shift+PageDown as you would in the normal terminal.

bind -n Pageup copy-mode -u
bind -n S-Pageup copy-mode -u
bind -n S-Pagedown send-keys Pagedown

If you're using Vim, you'll want to conditionally enable this binding or it'll mess things up when you use PageUp, etc in vim inside of tmux.

is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
    | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind -n Pageup if-shell "$is_vim" "send-keys Pageup" "copy-mode -u"
bind -n S-Pageup if-shell "$is_vim" "send-keys Pageup" "copy-mode -u"
bind -n S-Pagedown send-keys Pagedown

(Thanks to @mjwhitta's solution, which this refines)


To scroll up you can do:

bind -n S-Pageup copy-mode -u

The above doesn't appear to work on a Mac, so I tested with:

bind -n S-Up copy-mode -u

As far as I can tell, after pressing S-Up, you can continue to use S-Up or just page-up to keep scrolling up. You can use page-down to scroll down. These aren't exactly the key-bindings you were looking for, so I apologize. This should get you closer to your goal I hope.

EDIT:

I just tested with:

bind -n Pageup copy-mode -u

and this allows you to use just page-up and page-down.