1

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?

1 Answer 1

2

-[z]n or --window=n

Changes the default scrolling window size to n lines. The default is one screenful. The z and w commands can also be used to change the window size. The "z" may be omitted for compatibility with some versions of more. If the number n is negative, it indicates n 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…".

1
  • Ah okay. it's impossible to find this by simply grepping for -z.
    – Steven Lu
    Jun 27, 2017 at 15:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .