[NCLUG] vi[m] vs. "z<CR>", "z.", and "z-" for vertical scrolling

Gabriel L. Somlo gsomlo at gmail.com
Mon Dec 9 11:45:43 MST 2019


On Mon, Dec 09, 2019 at 01:16:52PM -0500, Gabriel L. Somlo wrote:
> Been using vi for a while, and over the last year or two (at least
> several months) I started noticing how when trying to put the current
> line to either top or bottom of the screen ("z<enter>" or "z-"), it
> actually goes only to 5 lines below top (or above bottom), not
> actually *all the way* to the top or bottom.

NVM, it's the new default value for "scrolloff":
https://stackoverflow.com/questions/56234414/vim-why-shifth-and-shiftl-not-jumping-on-the-first-and-last-line-on-the-scree
(funny how Google returns that on the first page only *after* one has
figured out they need to include "scrolloff" in their search terms :)

At this point I don't care if it was the fedora packagers or vim
upstream that started it... It's just somewhat funny it took me a year
or two to really notice, and figure that it annoys me enough to bother
getting to the bottom of it...

Now, on to the difficult decision of whether I should grumpily set
it back to 0 in my .vimrc, or continue to put up with it because it
"makes some sort of weird ergonomic sense"... :)

Thanks,
--G
 
> Today I finally got annoyed enough by it to google for why this might
> be, or why the behavior might have been changed, but as it turns out,
> my google-fu is particularly weak today, and I can't even come up with
> a decent query articulating what I'm looking for :)
> 
> All I'm getting is results telling me that if I hit those key
> combinations, my text would be scrolled with the current line to the
> top/middle/bottom of the screen, which I knew already. Nothing about
> "five lines away from the actual intened target", and where that's
> coming from.
> 
> Anyone able to shed some light on this mystery? :)
> 
> Thanks,
> --Gabriel


More information about the NCLUG mailing list