Simply put, what does the -z
flag to less
do? In the prezto (zsh shell) config, the $LESS
env var is set with flags and the last one is -z-4
.
What does this do? Is there a version of a less manpage somewhere that has this?
-[z]n
or--window=n
Changes the default scrolling window size to
n
lines. The default is one screenful. Thez
andw
commands can also be used to change the window size. The "z" may be omitted for compatibility with some versions ofmore
. If the numbern
is negative, it indicatesn
lines less than the current screen size. For example, if the screen is 24 lines,-z-4
sets the scrolling window to 20 lines. If the screen is resized to 40 lines, the scrolling window automatically changes to 36 lines.
Source: man page for less
(Linux 2.6).
Note: my tests indicate that 0
is treated as "negative" in this context. The relevant fragment should say "if the number n
is nonpositive…".