[idea] Add z keybinding to center the cursor line in copy mode
#731
irwinarruda
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
idea / problem
I am coming from tmux, where I use
prefix + [copy mode heavily. One tmux habit I miss is pressingzto center the current cursor line in the viewport.That behavior is useful when reading scrollback: I can navigate to the line I care about, press
z, and continue reading with that line centered instead of stuck near the top or bottom of the pane.requested change
Add a
zkeybinding in copy mode that centers the current cursor line vertically in the visible viewport.Expected behavior:
zcenters the current cursor line.zkeeps the active selection intact and centers the active cursor line.I've tried solving the issue already locally. The core idea is:
With an implementation that computes the current absolute row, moves the viewport so that row lands around inner_rect.height / 2, clamps at scrollback boundaries, then syncs the copy-mode selection again.
why you want this
This would make Herdr match even more tmux's copy mode behaviour.
I know only a little Rust today, but with AI help I was able to prototype the small change locally and get a clearer sense of how Herdr’s copy-mode state works. If I'm approved to contribute, I would for sure learn Rust properly so I can contribute more over time.
All reactions