Hi,
Adding a new tmux built-in function to do this would be great and that is really the point of this post.
But just for fun, a mapping such as:
bind-key -T copy-mode-vi z switch-client -T LEADERZ
bind-key -T LEADERZ z if -F "#{e|>=|:#{copy_cursor_y},#{e|/|:#{pane_height},2}}" "run \"tmux send -XN #{e|-|:#{copy_cursor_y},#{e|/|:#{pane_height},2}} scroll-down ; tmux send -XN #{e|-|:#{copy_cursor_y},#{e|/|:#{pane_height},2}} cursor-up\"" "run \"tmux send -XN #{e|-|:#{e|/|:#{pane_height},2},#{copy_cursor_y}} scroll-up ; tmux send -XN #{e|-|:#{e|/|:#{pane_height},2},#{copy_cursor_y}} cursor-down\""
I think gets close to vi's zz command, except for some corner cases.
And I am sure there is a much better way, to common up some values, and a way to get everything evaluated without using run-shell for example.
But it is fun to see what you can do with just a few minutes of messing around with bindings :-)
thx,
-m