Dynamic/fractional scrolloff #8408
Replies: 2 comments
-
no other editor I am aware of has this feature (checked kakoune, nvim, vim) and it seems a bit niche. The idea behind scrolloff is generally to show a couple of lines of context (which is of course capped to half the window). If you think about it as N lines of context then having those context lines depend on the view size doesn't make much sense. This also doesn't really scale well to large or smaller views (small fraction would quickly round down to 0 and large fractions would leave huge amounts of free space/scorlloff). I don't think this is something that we should support in core, it's too niche. Once a plugin system lands it may be possible to create a plugin for this (simply set the view scrolloff setting to |
Beta Was this translation helpful? Give feedback.
-
I get your point about the context. I just feel that when I modify the scrolloff to fit a small screen, this scrolloff suddenly feels too small on a big screen even though you get the same context. Setting the scrolloff to some large number like 999 also seems like a hacky way of defining 1/2 view scrolloff. Solving huge and tiny screens could be done by having a fraction + min/max scrolloff, such that it uses a fraction of the screen as long as it is between the min/max values. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It would be really nice if we could set the scrolloff to be, say, one fourth of the current view.
Right now, setting the scrolloff to say 20 and then reducing the size of the terminal, could potentially lead to an effect of having scrolloff=999, where the view always moves. This effect is quite jarring. The effect is of course the opposite if the terminal is enlargened (which could also be annoying).
Beta Was this translation helpful? Give feedback.
All reactions