I often find myself wanting to scroll a Vim window so that the line I’m on is roughly a quarter of the screen down—it provides more room to breathe than zt, but has more code displayed than zz. It’s also helpful when my cursor is at the start of a function I want to read, but zt will cut off the Javadoc-like comments.
Is there some magic I can use to do this? I’m afraid I don’t understand Vim’s scripting at all.
Perhaps
set scrolloff=5(or how many lines above and below the cursor you would like) will do the trick for you. It isn’t exactly what you asked for, but close enough?