helix
helix copied to clipboard
Accessibility Improvement - Option for always centering cursor vertically
Describe your feature request
This is a complimentary feature request for #3217.
The idea for this feature is to add an option in the [editor] config to always keep the cursor centered on the screen vertically. This would make finding the cursor relatively trivial, as one would only have to scan a single predictable line instead of needing to look everywhere.
The exact behavior should be as described:
On any line change, automatically scroll the viewport so that the cursor is exactly in the center.
Just set the scrolloff config value to something really high (999).
@archseer that did not seem to provide the desired behavior.
So upon further testing, scrolloff does provide the desired behavior, but only when the file is larger than the viewport, and does not function as intended near the top of the file,.
Not a real solution but while waiting for an implementation, you can use zz to center the cursor when not at the top of the file. Quite cumbersome if you always want the cursor to be centered on each line change sadly :/
I am looking for something related. I want helix to mimic the way vim behaves with scrolloff = 999. Specifically, I want it to never display empty lines past the beginning or the end of the file, at the expense of allowing the cursor to be not in the center of the screen.
Right now, with scrolloff = 999, at the top of a file it breaks the cursor centering rule so that the entire screen is filled with the file contents:

But when I scroll to the bottom of the file, half of the screen is empty:

This is inconsistent. I would expect it to do one of two things:
- Always display the cursor in the middle of the screen, even if that means printing blank lines above or below it.
- Always display a full screen of text when the file is longer than the height of the screen. When at the top or the bottom of a file, allow the cursor to deviate from its position in the middle of the screen. This is how vim behaves.
I propose introducing an option that lets the user configure this behaviour. That way, both @jquesada2016 and I can get what we want :)
There's an added nuisance in that even with scrolloff = 999 there's wiggle room around the cursor when direction of motion is changed (j to k or vice versa). Visually, this behaves like a long typematic delay, i.e. pretty annoying!
Any updates?